Why is the total memory not equal to the sum of live bytes?

Notice that when you select "memory profiling" you have an option to select "Track every X object allocations." By default X=10 so the snapshot is showing you information on approximately 10% of the objects that were allocated by your application on the heap. If you change X to 1 then the numbers you see in the snapshot will more closely match the values reported by the Basic Telemetry. But they will still not add up exactly correctly. This is because the profiler itself has to place objects on the heap in order to track your application's behavior.

The other impact of changing X to 1 is that you will dramatically increase the overhead imposed by the profiler (both in terms of CPU time it uses and memory). Typically the memory leak patterns you are looking for are apparent with the default value of X = 10, but your mileage may vary.

Back to NetBeans IDE Profiling FAQs

Back to NetBeans User FAQs

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo