The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search
Class calypso.util.MemoryMonitor
All Packages  This Package  Class Hierarchy  Class Search  Index

Class calypso.util.MemoryMonitor

java.lang.Object
   |
   +----calypso.util.MemoryMonitor

A utility class to help track memory usage during development. The interface is simple. Just create the monitor, do your business, and then invoke the done method.

The figure for the ammount of memory allocated should be accurate but the number for the ammount of garbage can be off by quite a bit if any garbage collection was done between the monitor's creation and the call to done.

Currently, it just prints some stuff to the console. I'd like to extend it so it creates a window and displays it's info in that.


public class  MemoryMonitor
     extends java.lang.Object
{
          // Fields 5
     long fFreeAtEnd;
     long fFreeAtStart;
     long fGarbageGenerated;
     Runtime fSystem;
     String fUserString;

          // Constructors 2
     public MemoryMonitor();
     public MemoryMonitor(String);

          // Methods 5
     void beginMonitor();
     public void done();
     void finishMonitor();
     protected void freeUpMemory();
     protected void initialize();
}



Fields


fSystem

   Runtime fSystem


fFreeAtStart

   long fFreeAtStart


fFreeAtEnd

   long fFreeAtEnd


fGarbageGenerated

   long fGarbageGenerated


fUserString

   String fUserString



Constructors


MemoryMonitor

   public MemoryMonitor(String monitorDescription) 


MemoryMonitor

   public MemoryMonitor() 



Methods


initialize

   protected void initialize() 


done

   public void done() 


freeUpMemory

   protected void freeUpMemory() 


beginMonitor

   void beginMonitor() 


finishMonitor

   void finishMonitor() 


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4
Copyright © 1998-2000 The Mozilla Organization.
Last modified December 25, 1998.