On 23 November 2010 00:47, Tim Jenness <[log in to unmask]> wrote:
> So did this get resolved? David mentioned to me that he looked into it and came up with a fix but I don't see any commits to the starjava repository in a month.
>
> It would be nice if the one and only user of JNIAST that is not an ex-Starlink person can use it properly again without having to do an exec.
I sent a suggested fix to Mark - I'm waiting to hear from him if it
looks like a goer or not.
David
> Tim
>
> On Oct 22, 2010, at 4:24 AM, Mark Taylor wrote:
>
>> Hi all,
>>
>> following a bug report from Mike Read (I didn't know anybody apart
>> from SPLAT and Treeview was using JNIAST), it seems there are memory
>> leak issues with the JNIAST FitsChan. In fact there are leaks both
>> in the java heap and in the C heap. Mike was creating, using, and
>> discarding (via the gc) millions of FitsChans in a servlet,
>> and this was causing the JVM to generate OutOfMemoryErrors and/or
>> the process to allocate so much system virtual memory that it got
>> terminated.
>>
>> I spent some effort (~ 1 day) looking into this; the code (mine)
>> is a nasty combination of clever and incorrect, my only excuse is
>> that it was one of the earliest bits of java I'd written.
>> I can improve matters somewhat; I can fix the Java leak, though
>> not very elegantly, but memory still seems to be leaking on the C side.
>> No doubt a solution exists, but I really don't have the leisure
>> to look into this any more in the forseeable future, so I'm just
>> going to have to put a warning sign on the FitsChan class.
>> Probably, the number of people creating a large number of JNIAST
>> FitsChans is small (=1), so I doubt this will cause widespread
>> inconvenience. I sorted Mike out with an alternative arrangement
>> which involves doing an exec from java to a pure AST binary.
>>
>> This message is just to notify anybody who is now or might in the future
>> try to work with, or handle bug reports about, JNIAST FitsChans,
>> that there is a known problem. Of course if somebody else is keen
>> to attempt to fix it, they're welcome.
>>
>> The AST FitsChan class itself is quite blameless.
>>
>> Mark
>>
>> --
>> Mark Taylor Astronomical Programmer Physics, Bristol University, UK
>> [log in to unmask] +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/
>
> --
> Tim Jenness
> Joint Astronomy Centre
>
|