You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that ObjectGraphMeasurer does not take into account the memory used by
an array. It handles visiting the elements in the array, but the array itself
is only incrementing the object count by 1. This causes severe underestimation
of memory used since the best we can do with Footprint is to multiply object
count by 16 (overhead in bytes for an object) plus a little randomness for
padding.
Java collections use a lot of arrays internally, so even if you don't use
arrays directly in your code, there can still be lots of arrays in use
indirectly. These arrays can take up a lot a memory based on length * size of
objects in array (anywhere from 1, 2, 4 or 8).
Perhaps Footprint could return arrays the same way it returns primitives which
would allow caller to more accurately estimate size by doing the multiplication
after graph is visited.
Original issue reported on code.google.com by [email protected] on 29 Jul 2014 at 5:23
The text was updated successfully, but these errors were encountered:
Never mind. Not as big a difference as stated in bug. Array memory block is
accounted for. Only extra 4 bytes for length of array object is not accounted
for.
Original issue reported on code.google.com by
[email protected]
on 29 Jul 2014 at 5:23The text was updated successfully, but these errors were encountered: