[Helma-user] Parsing JSON
Hannes Wallnoefer
hannes at helma.at
Tue Nov 27 19:19:49 CET 2007
Hi Kris,
On 11/26/07, Kris Leite <kleite at imcsoftware.com> wrote:
> In case anybody is parsing a large number of JSON strings and found
> memory leakage issues you might consider replacing the Rhino Eval
> command with another JSON parser.
Is this something you can reproduce, or does it happen intermittently?
Because if it is a problem with Rhino, I'd rather have this fixed.
> I found that using the JSON parser in Helma, that uses the Rhino Eval
> command, to cause unexplained memory lost when using it to parse some
> 75K+ small JSON strings. This occurred with a single long running task
> that using JSON strings for passing data between a Helma server and
Can you send me some test data or code?
> another computer. When I replaced the Rhino Eval with a javascript JSON
> parser, my memory lost disappeared.
>
> I also found a couple changes to Property.java to be useful also:
>
> 1) Changed the line in 'setStringValue' from:
>
> value = str:
>
> to:
>
> value = (str == null) ? null : new String(str);
>
> 2) Changed the line 'Property(String propname, Node node)' from:
>
> this.propname = propname;
>
> to:
>
> this.propname = (propname == null) ? null : new String(propname);
That would be strange, but it would be possible if these strings are
somehow used in weak references. I'll look into this.
hannes
> Your Mileage May Vary,
> Kris
>
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>
More information about the Helma-user
mailing list