Skip to content

Commit da1b0be

Browse files
committed
Update tuning.md
1 parent 3bd3129 commit da1b0be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/tuning.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ than the "raw" data inside their fields. This is due to several reasons:
9090
* Each distinct Java object has an "object header", which is about 16 bytes and contains information
9191
such as a pointer to its class. For an object with very little data in it (say one `Int` field), this
9292
can be bigger than the data.
93-
* Java Strings have about 40 bytes of overhead over the raw string data (since they store it in an
93+
* Java `String`s have about 40 bytes of overhead over the raw string data (since they store it in an
9494
array of `Char`s and keep extra data such as the length), and store each character
95-
as *two* bytes due to Unicode. Thus a 10-character string can easily consume 60 bytes.
95+
as *two* bytes due to `String`'s internal usage of UTF-16 encoding. Thus a 10-character string can
96+
easily consume 60 bytes.
9697
* Common collection classes, such as `HashMap` and `LinkedList`, use linked data structures, where
9798
there is a "wrapper" object for each entry (e.g. `Map.Entry`). This object not only has a header,
9899
but also pointers (typically 8 bytes each) to the next object in the list.

0 commit comments

Comments
 (0)