We are running SpiderMonkey in an embedded system, but had a memory issue.
for (var i=0; i<100000; i++)
read() is a function implemented in C like this,
static JSBool readNative(JSContext* cx, JSObject* obj, uintN argc, jsval*
argv, jsval* rval)
memset(buf, 'a', 1024);
*rval = STRING_TO_JSVAL(JS_NewStringCopyN(cx, buf, 1024));
eventually exhausts memory. Is the JSString created by JS_NewStringCopyN