Reduce native code data memory usage for in-proc jit #1829
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In OOP JIT when allocating native code data we record some information about the allocation. At the end of a JIT work item, the allocation information is used to make the pointer fixing up table which then used to fixup the internal pointers after passing native code data to runtime process. After a JIT work item is done, all the native code data including the allocation information are freed in JIT server, only the fixup table and aggregated data buffer is passed to runtime process. The fixup table is freed right after doing fixup in runntime process after the codegen call returned.
When doing in-proc jit we don't need these fixup information, and we don't do pointer fixing up and data aggregating/copying, the the fixup information has same life time as the native code data themselves, thus wasting memory.
This change bring back the same data structure which before the OOP JIT change and use it for in-proc JIT
Note in OOP JIT it uses one pointer size less memory than in-proc JIT because even the next pointer on DataChunk is not kept after data aggregating.