Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Interface java.lang.Runtime.MemoryAdvice


public static interface Runtime.MemoryAdvice
The MemoryAdvice interface defines the values returned by the getMemoryAdvice and waitForMemoryAdvice methods of the Runtime class. These methods allow a program to query the runtime system for advice about how it should manage its memory usage. There are four increasingly-dire levels of advice.

Since:
JDK1.2
See Also:
waitForMemoryAdvice, getMemoryAdvice

Field Summary
static int  GREEN
A memory-advice level of GREEN tells the program that no special actions are suggested.
static int  ORANGE
A memory-advice level of ORANGE tells the program that it should try to discard objects as soon as possible in order to maintain good performance.
static int  RED
A memory-advice level of RED tells the program that it should take every conceivable action to discard objects.
static int  YELLOW
A memory-advice level of YELLOW tells the program that it would be beneficial, but not essential, to discard some objects in the near future.
 

Field Detail

GREEN

public static final int GREEN
A memory-advice level of GREEN tells the program that no special actions are suggested.

YELLOW

public static final int YELLOW
A memory-advice level of YELLOW tells the program that it would be beneficial, but not essential, to discard some objects in the near future. On a system with virtual memory, this level typically implies that the virtual machine will soon request additional memory resources. If the maximum size of the heap is set when the virtual machine starts, this level typically implies that a preset low-memory threshold has been reached. Note that these two conditions are not mutually exclusive.

ORANGE

public static final int ORANGE
A memory-advice level of ORANGE tells the program that it should try to discard objects as soon as possible in order to maintain good performance. On a system with virtual memory, this level typically implies that paging is imminent. If the maximum size of the heap is set when the virtual machine starts, this level typically implies that a preset very-low-memory threshold has been reached. Note that these two conditions are not mutually exclusive.

RED

public static final int RED
A memory-advice level of RED tells the program that it should take every conceivable action to discard objects. This level typically means that very little memory is left. Any cleanup actions should, therefore, allocate as few objects as possible.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.