Reputation: 456
We have an intermittent performance issue on one of our servers reported by a couple of users when using one particular XPages application. My first thought was that it was related to Java Memory usage and poor code recycling so I'm starting there. At the moment, according to Mark Leusink's fantastic Debug Toolbar, the usage data for the server (64-bit Windows machine with 32Gb physical RAM) looks like this:
I'd like to confirm my understanding of the figures:
Bonus questions:
Thanks
Upvotes: 0
Views: 1330
Reputation: 3757
The information shown in the toolbar are the standard numbers that the JVM provides: totalMemory()
, maxMemory()
and freeMemory()
. See this question for a detailed explanation. The three values given are for the entire JVM, not a specific application.
In the Domino HTTP JVM you can set the maxMemory
with the HTTPJVMMaxHeapSize
notes.ini parameter. You cannot set/ change the total allocated (totalMemory) value, but that's also not needed. The JVM will simply allocate more memory when it needs it (up to the value of maxMemory
). When garbage collection has been performed, it will eventually also free this memory again.
Java agents do not affect these numbers. The only exception would be a Java agent that runs in the HTTP process (e.g. called from a browser using the ?OpenAgent command).
On a server you can run into memory issues (OutOfMemory exceptions) if the JVM needs more memory that can be allocated. You can monitor this value by creating a simple XAgent to output the current values for the JVM:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" rendered="false" viewState="nostate">
<xp:this.afterRenderResponse><![CDATA[#{javascript:
var externalContext = facesContext.getExternalContext();
var writer = facesContext.getResponseWriter();
var response = externalContext.getResponse();
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-cache");
var max = java.lang.Runtime.getRuntime().maxMemory();
var free = java.lang.Runtime.getRuntime().freeMemory();
var total = java.lang.Runtime.getRuntime().totalMemory();
var memory = {
max : max,
total : total,
free : free,
available : (max - total) + free
};
writer.write( toJson(memory) );
writer.endDocument();
}]]>
</xp:this.afterRenderResponse>
</xp:view>
Upvotes: 3