Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tuning.md #384

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ than the "raw" data inside their fields. This is due to several reasons:
* Each distinct Java object has an "object header", which is about 16 bytes and contains information
such as a pointer to its class. For an object with very little data in it (say one `Int` field), this
can be bigger than the data.
* Java Strings have about 40 bytes of overhead over the raw string data (since they store it in an
* Java `String`s have about 40 bytes of overhead over the raw string data (since they store it in an
array of `Char`s and keep extra data such as the length), and store each character
as *two* bytes due to Unicode. Thus a 10-character string can easily consume 60 bytes.
as *two* bytes due to `String`'s internal usage of UTF-16 encoding. Thus a 10-character string can
easily consume 60 bytes.
* Common collection classes, such as `HashMap` and `LinkedList`, use linked data structures, where
there is a "wrapper" object for each entry (e.g. `Map.Entry`). This object not only has a header,
but also pointers (typically 8 bytes each) to the next object in the list.
Expand Down