swarm-support
[Top][All Lists]
Advanced

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

Re: Grid2dImpl question (java)


From: Marcus G. Daniels
Subject: Re: Grid2dImpl question (java)
Date: 21 Sep 2001 11:51:14 -0600
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

>>>>> "MA" == Myriam Abramson <address@hidden> writes:

MA> What's the difference between fastFillWithObject and
MA> fillWithObject?  Why not always use the fast one?

-fastFillWithObject doesn't call -putObject:atX:Y:.  That only matters
if you want to have a subclass that does something special when the
method is called.  For example, if the subclass used transactions on a
database the mechanism for getting and putting objects on the grid would
be very different.

MA> I'm still investigating my memory leaks. I've switched some
MA> objects from being SwarmImpl objects to java objects and now it
MA> seems that my memory leaks are worse :( One of those objects was
MA> used in a Grid2dImpl with putObject$atX$Y. Should those objects be
MA> swarm objects then for garbage collection purposes?

It's not going to help to make pure Java objects in this case because
those Java objects will need proxies in order to be inserted into the
grid.  When you remove those objects from the grid, the proxies will
remain and keep the unused objects from being collected.  So, since
you're going to need to call drop anyway (for the proxy) you might as
well just use SwarmObjectImpl.

Alternatively, when one schedules messages targeting Java classes,
it's good to use pure Java objects because no proxy is needed.  The
callout can be setup ahead of time into a Java-only call, and thus
avoid the memory overhead of proxies.  (Incidentally, in the recent
snapshot versions of Swarm, there are no longer cross-language lookup
costs for objects.  There are still costs for cross language selector
and class arguments, but they are lower since the tree of things to
search is much smaller since the objects are factored out.)

                  ==================================
   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]