Windows 32-bit
operating systems have a default user space limit of 2 GB, so might
be more prone than other operating systems to native out-of-memory
conditions. Use the perfmon tool supplied with Windows to gather memory usage
information on a Java™ or Node.js
process.
Before you begin
If possible, ensure that only the Java or Node.js process that you want to monitor
is running. If multiple Java or
Node.js processes are running, it will be difficult for you to select
the process that you want to monitor, because the
perfmon tool
lists processes by their name only, for example
java or
javaw.
Procedure
- Start the application to be monitored.
- Start the perfmon tool. From
the Start menu, click Run... to
open the Run dialog window. Type perfmon in
the Open field, then click OK to
start the perfmon tool.
- Create a counter log.
- Expand Performance Logs and Alerts and
click Counter Logs. Right-click the space under
the System Overview log and click New
Log Settings.... The New Log
Settings window opens.
- Type a name for the log file, for example Java
Memory Usage, then click OK. A dialog window opens; the title of the window is the
name that you supplied.
- Make a note of the value of the Current log
file name field, so that you know where to retrieve the
log file from after it is created.
- Click Add Counters.... The Add
Counters dialog window opens.
- In the Performance object list,
select Process.
- Click Select counters from list,
then from the list of counters select Virtual Bytes.
- Click Select instances from list,
then from the list of instances select the process name, for example java,
or javaw. This list shows only the process
name, so the process that you want to monitor is easier to identify
if you have no other Java or
Node.js processes running.
- Click Add, then Close. The counter is now visible in the previous dialog window.
- Click the Log Files tab, then
from the Log file type list select Text
File (Comma delimited).
- Click the Schedule tab, then
in the Start log section click Manually
(using the shortcut menu). Click OK. You might see a dialog box asking if you want to create the PerfLogs folder.
Click Yes to create the folder suggested, or
click No, then specify a different folder in
the General tab.
You counter log is now visible in the main
pane of the perfmon tool.
- Start the log by right-clicking it and clicking Start. The icon changes to green to show that the log is being generated.
- Leave the log running to collect data. Depending
on the nature of the problem you are diagnosing, you might have to
run the log for a significant amount of time to collect enough data
to make some conclusions.
- When you have sufficient data, stop the log by right-clicking
it and clicking Stop.
What to do next
You can now open the log file in the IBM® Monitoring and Diagnostic Tools - Garbage
Collection and Memory Visualizer. If you did not make a note of the
location of the log file, double-click the name of the log to view
the properties dialog window. The location of the log file is shown
on the
General tab.