for( i = 1; i < 126000; i ++ )
{
myExposedMethod("myclass.name = " + myclass.name );
}
where myExposedMethod is a C function exposed to the script by
embedding host. Similarly myclass is also an class exposed by
embeddnig host. myclass.name is a string which remains rooted
( JS_AddRoot ). I even made myExposedMethod to just do nothing and
return JS_TRUE, still I am seeing the issue. On spidermonkey 1.5, this
works fine even with loop count increased to 10 times higher.
While debugging I went through the code path of spidermonkey. It
turns out that it performs a concatation of string always and during
that it allocates memory. It looks like the memory is not getting
gc'ed here.
I am also facing JS OUT OF Memory issue in JS 1.5 and JS 1.8 both on usage
of JS functions. Can you share myExposedMethod implementation?
Similarity in our script regarding usage of functions, can help to know
cause of problem. Thanks.
Regards
Puneet
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine
extern "C"
static JSBool
myExposedMethod (JSContext *cx, JSObject *obj, uintN argc, jsval
*argv, jsval *rval)
{
return JS_TRUE;
}
On Dec 28 2009, 11:15 pm, Puneet Sharma <punee...@huawei.com> wrote:
> Hi,
>
> I am also facing JS OUT OF Memory issue in JS 1.5 and JS 1.8 both on usage
> of JS functions. Can you share myExposedMethod implementation?
>
> Similarity in our script regarding usage of functions, can help to know
> cause of problem. Thanks.
>
> Regards
> Puneet
>
> -----Original Message-----
> From:
>
> dev-tech-js-engine-bounces+engg.puneetsharma=gmail....@lists.mozilla.org
> [mailto:dev-tech-js-engine-bounces+engg.puneetsharma=gmail....@lists.mozilla
> .org] On Behalf Of sandeep
> Sent: Wednesday, December 23, 2009 1:08 PM
> To: dev-tech-js-eng...@lists.mozilla.org
> Subject: out of memory error from spidermonkey 1.7 ( not seen on 1.5 )
>
> I am seeing an issue with 1.7 where it is giving out of memory error.
> Spidermonkey 1.5 works fine. We have this script,
>
> for( i = 1; i < 126000; i ++ )
> {
> myExposedMethod("myclass.name = " + myclass.name );
> }
>
> where myExposedMethod is a C function exposed to the script by
> embedding host. Similarly myclass is also an class exposed by
> embeddnig host. myclass.name is a string which remains rooted
> ( JS_AddRoot ). I even made myExposedMethod to just do nothing and
> return JS_TRUE, still I am seeing the issue. On spidermonkey 1.5, this
> works fine even with loop count increased to 10 times higher.
>
> While debugging I went through the code path of spidermonkey. It
> turns out that it performs a concatation of string always and during
> that it allocates memory. It looks like the memory is not getting
> gc'ed here.
> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-js-eng...@lists.mozilla.orghttps://lists.mozilla.org/listinfo/dev-tech-js-engine