[Top][All Lists]

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

Re: [swarm-hackers] Memory leak in Swarm

From: Marcus G. Daniels
Subject: Re: [swarm-hackers] Memory leak in Swarm
Date: Fri, 03 Oct 2008 16:16:31 -0600
User-agent: Thunderbird (Windows/20080708)

Steve Railsback wrote:
A few months ago Steve Jackson went through a big exercise with Valgrind to get memory leaks out of our big fish model. Some of them turned out to be in Swarm, and I finally got him to take a moment or two from his new job as math professor to tell me at least the one that bugged him the most.

Apparently when you call Symbol getName, the method uses a string dup that leaves a string in the scratch zone.

Perhaps Scott or somebody mucking in the code could deactivate that feature?
The current intent is to have all callers of getName _within Swarm_ free that object as soon as they are done with it. There are some cases of that as I recall, but I thought they were covered.

If the caller is your code, then you can free that object.

The reason it is allocated in scratch space is because in the case of Java (or other foreign languages), there is no preallocated and fixed memory for the object. Foreign objects are potentially being moved around by a garbage collector, so any memory handle you get out of them is volatile. Thus it must be immediately copied.

reply via email to

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