swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory in java


From: Marcus G. Daniels
Subject: Re: memory in java
Date: 23 Dec 1999 23:24:35 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "JR" == Juan A Rodriguez <address@hidden> writes:

JR> Most of the classes that I have do not extend swarm
JR> classes.  So I didn't expect any memory problems that I get even
JR> enforcing garbage collection. 

Ok.  Right now, my suggestion is to study how your code uses Swarm
features, and think about how those features persist or grow.

If you've already pulled out your hair doing that, then you
might survey the various Zones you use (e.g. sending Swarms getZone), and
sending the Zones getPopulation (a swarm.collection.List) in order
to see what objects are in what Zones.

The Objective C describe: method on Zone reports some useful statistics,
but unfortunately that method takes an OutputStream as an argument, and
OutputStream is disabled in java-stub.el.  To get around that you
can either re-enable it and rebuild/reinstall Swarm or create a new
Java class that acts like it.  
 
If you are using a glibc-based system (e.g. a Linux-based systems),
malloc has hooks that can be used to track allocations.  One tool that
makes use of these hooks is memprof
http://people.redhat.com/otaylor/memprof.  Memprof is nice because it
can be used without re-compiling Swarm or your model.  (Although it
isn't as powerful as a package like Checker, and it can difficult to
digest all the info you get.)

Keep in mind that gdb can be used to control execution of a model, and
can be used to call functions (and thus Objective C methods or Java
methods).  gdb is a very flexible tool, given the will (and avoidance
of Windows).

JR> Perhaps it's got to do with an overuse of collections. 

If you mean Swarm collections, that could be complicating things.  
If your models are really grinding to slow massive death, there is
probably something important that is being overlooked.

Finally, if these options sound too expensive, there's the option of
posting self-contained Java code that demonstrates a leak.  Of course,
the smaller the example, the higher the probability of a prompt
analysis...

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]