Skip to content

Conversation

@leirocks
Copy link
Contributor

in medium heap blocks, if the object size is bigger than 1 page, it can cause the whole last 1~3 page(s) never been allocated. when such case is hit, decommit those pages to save memory as well as capture corruption. when returning the pages back to page allocator, we should commit those pages again for reuse, in case of OOM here, just decommit all pages in the heap block and let the page allocator to manage the decommitted pages.
in rescan code, asserting that we never scan those unallocatable pages

leirocks added 4 commits May 13, 2016 11:17
in medium heap blocks, if the object size is bigger than 1 page, it can cause the whole last 1~3 page(s) never been allocated. when such case is hit, decommit those pages to save memory as well as capture corruption. when returning the pages back to page allocator, we should commit those pages again for reuse, in case of OOM here, just decommit all pages in the heap block and let the page allocator to manage the decommitted pages.
in rescan code, asserting that we never scan those unallocatable pages
it's hard to make the partial decommit withou refactoring page allocator, especially in background releasing pages, there will have race issues. changing to protect with NOACCESS for now.
In the future after we implemented the capability of partially commit pages in pageAllocator we can change to use that, because that can save some memories.
@chakrabot chakrabot merged commit 0b5e565 into chakra-core:master May 13, 2016
chakrabot pushed a commit that referenced this pull request May 13, 2016
…2302)

Merge pull request #985 from leirocks:mediumdecommit1
in medium heap blocks, if the object size is bigger than 1 page, it can cause the whole last 1~3 page(s) never been allocated. when such case is hit, decommit those pages to save memory as well as capture corruption. when returning the pages back to page allocator, we should commit those pages again for reuse, in case of OOM here, just decommit all pages in the heap block and let the page allocator to manage the decommitted pages.
in rescan code, asserting that we never scan those unallocatable pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants