chakra-core / chakra-core/ChakraCore

Reducing the _X64WriteBarrierCardTableManager::_cardTable memory reservation

Open
#5,821 5 comments 0 reactions 0 assignees View on GitHub
Question
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hi, we are trying to reduce the memory reservation for the `_X64WriteBarrierCardTableManager::_cardTable`.
(for windows x64 with address space of 128TB it is reserving 32GB).
The default page size is 4KB and we are trying to make it 64 times bigger, i.e. 256KB.
We changed the following constants:
- [RecyclerWriteBarrierManager::s_WriteBarrierPageSize](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Memory/RecyclerWriteBarrierManager.h#L214), [RecyclerWriteBarrierManager::s_BytesPerCard](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Memory/RecyclerWriteBarrierManager.h#L217), [AutoSystemInfo::PageSize](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Core/SysInfo.h#L65), [CompileAssert in SysInfo.h](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Core/SysInfo.h#L138), [__in_ecount_pagesize](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Core/SysInfo.h#L139) and
[__in_ecount_twopagesize](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Core/SysInfo.h#L140) multiplied by 64.
- [HeapBlockMap::PagesPer4GB changed to 1 << 14](https://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Memory/HeapBlockMap.h#L292)

Is it safe to do it and is there a better way of doing it?
Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the constants and CompileAssert locations named in RecyclerWriteBarrierManager.h, SysInfo.h, and HeapBlockMap.h, then trace their usages in the memory-management code. Done means establishing whether the proposed page-size and card-table changes are safe and identifying a supported approach, with validation of the resulting memory reservation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.