You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following gc method compares the amount of free memory in the Java Virtual Machine before GC execution and after GC execution, If free memory is decreased by delta than before GC execution, the loop is exited.
Under this comparison condition, loops will be repeated even if free memory is increased by GC execution, is there a problem ?
As GC repeats, the load on the CPU increases, so there is concern about the delay in message broker processing.
protectedvoidgc(intcount, longdelta) {
if (!NO_GC) {
logger.log(Logger.DEBUG,"calling Runtime.freeMemory()");
longfree = Runtime.getRuntime().freeMemory();
inti = 0;
for (i = 0; i < count; i ++) {
Runtime.getRuntime().gc();
longnewfree = Runtime.getRuntime().freeMemory();
/* => */if (free - newfree > delta) {
// we freed enough memory break;
}
}
}
else{
// do nothing
}
}
Since this method is invoked when free memory decreases than before,
and because we have "we freed enough memory" in the comment,
I think that it is better to exit the loop if the free memory increases.
Using Open MQ version is 5.1.
Proposed fix
Correct the condition so that when the free memory in the Java virtual machine increases, it leaves the loop.
Previous fix
if (free - newfree > delta) {
After fix
if (newfree - free > delta) {
The text was updated successfully, but these errors were encountered:
The following gc method compares the amount of free memory in the Java Virtual Machine before GC execution and after GC execution, If free memory is decreased by delta than before GC execution, the loop is exited.
Under this comparison condition, loops will be repeated even if free memory is increased by GC execution, is there a problem ?
As GC repeats, the load on the CPU increases, so there is concern about the delay in message broker processing.
com.sun.messaging.jmq.jmsserver.memory.MemoryManager:
Since this method is invoked when free memory decreases than before,
and because we have "we freed enough memory" in the comment,
I think that it is better to exit the loop if the free memory increases.
Using Open MQ version is 5.1.
Proposed fix
Correct the condition so that when the free memory in the Java virtual machine increases, it leaves the loop.
Previous fix
After fix
The text was updated successfully, but these errors were encountered: