Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize copy node memory usage #1425

Merged
merged 1 commit into from
Mar 29, 2023
Merged

Optimize copy node memory usage #1425

merged 1 commit into from
Mar 29, 2023

Conversation

ray6080
Copy link
Contributor

@ray6080 ray6080 commented Mar 29, 2023

  1. Renaming
    Unifies copy related class names to TableCopier, NodeCopier, NpyNodeCopier and RelCopier.

  2. Optimize memory usage
    When copy node tables, we no longer prepare all pages needed by in memory columns, which can easily cause OOM when the node table is quite large, and increase memory pressure of the machine.
    Instead, each task will dynamically allocate a InMemColumnChunk, which contains a set of pages as needed. When the task has finished writing and flushing pages to disk, the task releases the column chunk, which can greatly reduce memory occupation.

@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Patch coverage: 96.10% and project coverage change: +0.01 🎉

Comparison is base (8f34ab1) 92.64% compared to head (19176d0) 92.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1425      +/-   ##
==========================================
+ Coverage   92.64%   92.66%   +0.01%     
==========================================
  Files         649      651       +2     
  Lines       22382    22507     +125     
==========================================
+ Hits        20735    20855     +120     
- Misses       1647     1652       +5     
Impacted Files Coverage Δ
src/include/common/types/types.h 100.00% <ø> (ø)
src/include/storage/copier/rel_copier.h 100.00% <ø> (ø)
src/storage/copier/table_copier.cpp 82.05% <88.23%> (ø)
src/storage/copier/node_copier.cpp 93.92% <91.07%> (-1.11%) ⬇️
...rage/in_mem_storage_structure/node_in_mem_column.h 95.34% <95.34%> (ø)
src/common/file_utils.cpp 71.83% <100.00%> (ø)
src/include/common/file_utils.h 100.00% <100.00%> (ø)
src/include/storage/copier/node_copier.h 100.00% <100.00%> (ø)
src/include/storage/copier/npy_node_copier.h 100.00% <100.00%> (ø)
src/include/storage/copier/table_copier.h 100.00% <100.00%> (ø)
... and 6 more

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ray6080 ray6080 merged commit e307fbc into master Mar 29, 2023
@ray6080 ray6080 deleted the low-mem-copy-os-allocate branch March 29, 2023 21:14
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.

None yet

2 participants