[jsc-dev] Setting a memory limit and inspecting current memory usage

Jérôme Gravel-Niquet jeromegn at gmail.com
Sun Sep 9 11:42:41 PDT 2018


> We have no way of doing this currently.

How would you recommend doing it? If there's a way to inspect the
memory usage of the VM, I might be able to implement logic for when to
garbage collect and such. Sounds sub-optimal though.

> I don’t believe we provide API for this. A VM knows its approximate heap size. Are you building your own copy of JSC or linking against the system library?

Building my own from webkit's source




On September 9, 2018 at 2:25:32 PM, Saam Barati
(sbarati at apple.com(mailto:sbarati at apple.com)) wrote:

>
>
> > On Sep 7, 2018, at 11:47 AM, Jérôme Gravel-Niquet wrote:
> >
> > Hey there,
> >
> > I just started playing with JavaScriptCore and I think it's a great
> > mix of flexibility and easy to use C API.
> >
> > I couldn't find information on how to limit the memory usage
> > (allocations) on a Context or ContextGroup. I'm mentioning these 2
> > because there's no way to get at a VirtualMachine from the C API.
> I believe the C API lets you access a context group, which is a VM.
>
> >
> > Is there a way to set a memory usage limit with JSC?
> We have no way of doing this currently.
>
> >
> > Can I inspect a context or group of contexts for current memory usage?
> I don’t believe we provide API for this. A VM knows its approximate heap size. Are you building your own copy of JSC or linking against the system library?
>
> - Saam
>
> >
> > If these are available through a non-C API, I might be able to create
> > my own C wrapper for those.
> >
> > Thanks,
> > Jerome Gravel-Niquet
> > _______________________________________________
> > jsc-dev mailing list
> > jsc-dev at lists.webkit.org
> > https://lists.webkit.org/mailman/listinfo/jsc-dev


More information about the jsc-dev mailing list