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

OOM with Excessive Memory Usage During Git Repository Import #238

Closed
genedna opened this issue Nov 17, 2023 · 2 comments · Fixed by #272
Closed

OOM with Excessive Memory Usage During Git Repository Import #238

genedna opened this issue Nov 17, 2023 · 2 comments · Fixed by #272
Assignees
Labels
bug Something isn't working

Comments

@genedna
Copy link
Member

genedna commented Nov 17, 2023

I am writing to report an issue I encountered while using Mega to import a Git repository. The repository in question is https://github.com/AFLplusplus/qemu-libafl-bridge.

During the import process, I noticed that Mega was consuming excessive memory while parsing Pack files. This high memory usage ultimately triggered the Linux system's Out-Of-Memory (OOM) killer, resulting in the termination of the Mega process.

So that you know, the system I am using has 16GB of RAM. Under idle conditions, it typically has around 13GB of available memory. Before this incident, no specific optimizations were applied to the system or Mega settings.

@genedna
Copy link
Member Author

genedna commented Nov 20, 2023

Upon analysis, it seems that the system, not having a swap partition, resorts to invoking the OOM killer when faced with high memory usage, leading to the termination of running programs. If sufficient memory cannot be freed, the system kills the active processes.

The current hypothesis is that this issue stems from poor memory control management during decoding Pack files. As a result, I am planning to rewrite this portion of the code to handle memory usage during decoding better.

@genedna
Copy link
Member Author

genedna commented Nov 20, 2023

I want to thank @Ivanbeethoven sincerely for their significant contribution to the project. Specifically, separating the Delta algorithm from the Pack encoding/decoding process is a remarkable improvement, as accomplished in pull requests #246 and #249.

The separation of concerns achieved through this refactoring not only enhances the readability and maintainability of the code but also opens up possibilities for reuse and extension in other areas of the project. I am excited about the potential application of this approach in the 'MDA' project in the feature through #202.

genedna added a commit to genedna/mega that referenced this issue Nov 26, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Nov 26, 2023
Refactoring the core of Mega #238
genedna added a commit to genedna/mega that referenced this issue Nov 28, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Nov 28, 2023
Refactoring the git internal #238
genedna added a commit to genedna/mega that referenced this issue Nov 28, 2023
github-merge-queue bot pushed a commit that referenced this issue Nov 29, 2023
Refactoring the hash to SHA1, add comments and test case #238
@genedna genedna reopened this Nov 30, 2023
genedna added a commit to genedna/mega that referenced this issue Nov 30, 2023
genedna added a commit to genedna/mega that referenced this issue Nov 30, 2023
github-merge-queue bot pushed a commit that referenced this issue Nov 30, 2023
Decode the pack file and not convert to objects yet #238
genedna added a commit to genedna/mega that referenced this issue Dec 1, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 1, 2023
Add signature check when decode pack files #238
genedna added a commit to genedna/mega that referenced this issue Dec 2, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Dec 4, 2023
Refactoring the HashCounter to Wrapper #238
genedna added a commit to genedna/mega that referenced this issue Dec 6, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 6, 2023
Refactoring the impl Pack to decode and utils #238
genedna added a commit to genedna/mega that referenced this issue Dec 7, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Dec 8, 2023
Refactoring the object types #238
genedna added a commit to genedna/mega that referenced this issue Dec 10, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
genedna added a commit to genedna/mega that referenced this issue Dec 10, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Dec 11, 2023
Add object type in pack decode func and from_bytes for blob #238
genedna added a commit to genedna/mega that referenced this issue Dec 11, 2023
Signed-off-by: Quanyi Ma <eli@patch.sh>
github-merge-queue bot pushed a commit that referenced this issue Jan 1, 2024
Add CacheOjbect and Caches in decode pack file #238
github-merge-queue bot pushed a commit that referenced this issue Jan 6, 2024
Add limited mem size and tmp file path for caches #238
@genedna genedna closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants