Welcome to the Linux Foundation Forum!

Object memory vs. heap memory

Options

According to a study on Java memory and properties:

"... The memory score partitions into two types: heap memory, which is the memory consumed by the application during runtime, and object memory, which is the memory allocated by various objects used in the program, such as integers and strings, etc. ..." When they mention object memory, do they mean the stack memory, or something else? (confused since, if I'm not mistaken, objects in Java are allocated on the heap)

Second, what tool should I use if I just want to measure the overall size of the heap and stack during whole programme execution? I looked about and attempted the built-in Java Profiler in NetBeans 7.3.1 and YourKit 12.0.6, where I can inspect the heap, but I couldn't find a means to investigate "objects" and variables placed on the stack!

To summarise, how do I quantify what the document describes:
1. Total heap memory employed
2. The total amount of object memory consumed
According to this source, string objects are in the heap, but the hashtable (the buckets and entries containing references and hash codes) is in off-heap memory. Is that right?
Thanks!

Categories

Upcoming Training