When profiling memory usage, you can create a custom configuration and set more advanced profiling options.
You set the advanced options by clicking Advanced Settings in the configuration pane for your custom configuration.
Click Basic Settings to set the configuration options in the Basic Options pane.
The Advanced Settings pane enables you to set the following options:
Settings
The following Settings options are only available when you select the Advanced
option in the Basic Settings pane.
Track every X allocations. Sets the interval /proportion
for stack sampling, e.g., if set to 10, this means that
for each class only every 10th object allocation will be recorded
completely.
(This only applies to stack sampling
and tracking the object. The total number of
object allocations is recorded separately, and includes all allocations.)
To record all information for each object, set this number to 1. However, doing this may substantially
affect the profiling overhead when profiling allocation-intensive applications. For
server-side applications under real-life workload conditions, setting this
number to 20 or more should be sufficient to minimize the overhead,
and still obtain sufficient information for practical purposes.
Record Stack Trace for Allocations. This setting can be modified when you select Record Stack Traces for Allocation
in the Basic Settings.
When recording object creation, the call stack at that moment is also recorded.
By default, the full stack depth is recorded.
You can limit the maximum depth of the recorded call stack
by entering a positive integer (e.g. 3) to limit the number of frames from the top of the stack that are recorded.
This can substantially reduce the profiling overhead.
For more about how the call stack is recorded, see the following NetBeans FAQ:
Run garbage collection when getting memory results. When selected,
full garbage collection is invoked in the target JVM each time you choose Profile > Run GC from the main menu.
This option may help you obtain a more realistic picture of object liveness, but it also increases overhead.
Running GC may help you to obtain a more realistic picture of object liveness because dead objects will be garbage collected and thus not reported as live.
Use caution when selecting this option because full GC may be expensive, especially for large applications (where it may take from several to several tens of seconds).
Threads
Enable Threads Monitoring. When selected, application threads are monitored from application startup.
When deselected (default), thread monitoring does not begin until you click the Threads button in the Threads window.
Sample Threads States. When selected, thread states are updated periodically.
This option is selected by default.