", used=" + used +
", max=" + max +
": runtime free=" + runtime.freeMemory() + ", tot=" + runtime.totalMemory() + ", max=" + runtime.maxMemory());
Logger.logTextResource(
new LogAlert(
LogAlert.REPEATABLE,
LogAlert.AT_WARNING,
"memmon.low.warning"),
new String[] {
(mb==0?"< ":"") + DisplayFormatters.formatByteCountToKiBEtc( Math.max(1,mb)*MB, true ),
DisplayFormatters.formatByteCountToKiBEtc( max_heap_mb*MB, true )});
if ( mb == 1 && !increase_tried ){
increase_tried = true;
if ( COConfigurationManager.getBooleanParameter( "jvm.heap.auto.increase.enable", true )){
PlatformManager platform = PlatformManagerFactory.getPlatformManager();
if ( platform.hasCapability( PlatformManagerCapabilities.AccessExplicitVMOptions )){
try{
String[] options = platform.getExplicitVMOptions();
long max_mem = getJVMLongOption( options, "-Xmx" );
if ( max_mem <= 0 ){
max_mem = getMaxHeapMB()*MB;
}
final long HEAP_AUTO_INCREASE_MAX = 256*MB;
final long HEAP_AUTO_INCREASE_BY = 16*MB;
if ( max_mem > 0 && max_mem < HEAP_AUTO_INCREASE_MAX ){
max_mem += HEAP_AUTO_INCREASE_BY;
if ( max_mem > HEAP_AUTO_INCREASE_MAX ){
max_mem = HEAP_AUTO_INCREASE_MAX;
}
long last_increase = COConfigurationManager.getLongParameter( "jvm.heap.auto.increase.last", 0 );
if ( max_mem > last_increase ){
COConfigurationManager.setParameter( "jvm.heap.auto.increase.last", max_mem );
options = setJVMLongOption( options, "-Xmx", max_mem );
platform.setExplicitVMOptions( options );
Logger.logTextResource(
new LogAlert(
LogAlert.REPEATABLE,
LogAlert.AT_WARNING,
"memmon.heap.auto.increase.warning"),
new String[] {
DisplayFormatters.formatByteCountToKiBEtc( max_mem, true )});