Article ID: 231294 - Last Review: June 14, 2006 - Revision: 5.0 SAMPLE: SmartGC Uses an ATL Server to Trigger Java Garbage CollectionThis article was previously published under Q231294 SUMMARY
Java applications can register a sink with the JVMmem ActiveX Template Library (ATL) server, which periodically monitors memory load. When a memory threshold is exceeded, the server fires a notification event to the Java application indicating that the Java garbage collector should be invoked.
SmartGC.exe provides a foundation for Java applications to more optimally control garbage collection. Since Java garbage collection is triggered by Virtual Memory (VM) usage, some applications may run more efficiently if garbage collection is triggered on available RAM or the process Working Set size. MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center: Gc.exe
(http://download.microsoft.com/download/vj60pro/samp1/1/win98/en-us/gc.exe)
SmartGc.exe
(http://download.microsoft.com/download/vj60pro/sample2/1/w9xnt4/en-us/smartgc.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
Collapse this table
The following steps describe how to use SmartGC.exe.
The current Available memory and current working set may take some time to return to initial levels, as Windows NT does not immediately trim the working set if there is no need for RAM. Notice the program calls SetProcessWorkingSetSize in the constructor to encourage Windows NT to limit the maximum Working Set. Use the following steps to test that the GC sink routine is actually forcing the freeing of memory and objects:
REFERENCES
For more information, see the following article in the Microsoft Knowledge Base:
231183
(http://support.microsoft.com/kb/231183/EN-US/
)
SAMPLE: Clean Up Java Resources Automatically with Gc.exe
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
http://www.microsoft.com/java
(http://www.microsoft.com/java)
APPLIES TO
| Article Translations
|

Back to the top
