[LLVMdev] Prevent unbounded memory consuption of long lived JIT processes

José Fonseca
2011-03-16T13:19:02Z

On Tue, 2011-03-15 at 20:29 -0700, Jakob Stoklund Olesen
wrote:
> On Mar 15, 2011, at 4:15 PM, jfonseca at vmware.com wrote:
>
> > This series of patches address several issues causing memory usage to
grow
> > indefinetely on a long lived process.
>
> Thanks for working on this.
>
> Did you measure the performance impact of these changes?

I tracked performance with this change with X86 JIT and there was no
measurable difference, but the performance was governed more by the
quality of the compiled code, and not so much the compilation time.

If you can point me to a good compilation time benchmark I can get some
figures.

I'd expect either no measurable impact in compilation time, or a slight
improvement due to smaller memory footprint:

- for patches 1-3 (prevent infinite growth of several hash maps data
types) should above all reduce memory usage; there might be some cases
(e.g., frequent updates with a small bounded number of elements) where
it may trade off an exponentially growing table size (i.e., memory) for
more rehashes (i.e., cpu), but that should be a win on nowadays
processors.

- patch 4 (Reset StringMap's NumTombstones on clears and rehashes)
should improve performance

- patch 5 refers to a function that doesn't get called frequently

Jose