Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

(chainbase) don’t keep file mapping active when in heap/locked mode #7434

Merged
merged 2 commits into from
May 29, 2019

Conversation

spoonincode
Copy link
Contributor

Change Description

When in heap or locked mapping mode, pinnable_mapped_file initially maps the database so that it can copy its contents in to the heap/locked memory. Then on shutdown it copies the heap/locked memory back to that mapped file.

This means that during execution in heap/locked mode the process actually shows double memory usage as expected: once for the mapped file that is kept around, and once for the heap/locked memory.

This change closes the mapping after its contents have been copied to the heap/locked memory. It then reopens the mapping on shutdown so that the contents can be copied back. So now during execution the database is only consuming the expected memory

Goes with EOSIO/chainbase#47

Also synced a low priority change that went in chainbase renaming a variable that was causing grief on win32 builds

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

When in heap or locked mapping mode, pinnable_mapped_file initially maps the database so that it can copy its contents in to the heap/locked memory. Then on shutdown it copies the heap/locked memory back to that mapped file.

This means that during execution in heap/locked mode the process actually shows double memory usage as expected: once for the mapped file that is kept around, and once for the heap/locked memory.

This change closes the mapping after its contents have been copied to the heap/locked memory. It then reopens the mapping on shutdown so that the contents can be copied back. So now during execution the database is only consuming the expected memory
@spoonincode spoonincode force-pushed the no_chainbase_double_map branch from f831469 to 9daf141 Compare May 29, 2019 19:55
@spoonincode spoonincode merged commit ed28532 into develop May 29, 2019
@spoonincode spoonincode deleted the no_chainbase_double_map branch May 29, 2019 20:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants