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

mapcidr uses too much RAM and crashes laptop #30

Closed
aerosayan opened this issue Jul 19, 2021 · 2 comments · Fixed by #32 or #34
Closed

mapcidr uses too much RAM and crashes laptop #30

aerosayan opened this issue Jul 19, 2021 · 2 comments · Fixed by #32 or #34
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@aerosayan
Copy link

aerosayan commented Jul 19, 2021

Describe the bug
echo 17.0.0.0/8 | mapcidr -silent uses up almost 1.5 GB RAM memory, and echo 17.0.0.0/2 | mapcidr -silent makes the computer unresponsive after consuming all of my 4 GB RAM. I'm submitting this as a bug report, since such high memory usage should have been documented well as a clear WARNING in the README.md, and even though I'm not very knowledgeable about mapcidr, I think such high memory requirement shouldn't be necessary for basic use as shown above.

Obviously some huge amount of dynamic memory allocation is happening inside the code.
Is that really required for expanding out the given input into IPs?
I would imagine it would be possible to simply print out the information directly without any memory allocation, or at least do it in batches so that memory requirement isn't so high.

Mapcidr version
v0.0.7

Complete command you used to reproduce this
echo 17.0.0.0/8 | mapcidr -silent and echo 17.0.0.0/2 | mapcidr -silent

@Mzack9999 Mzack9999 self-assigned this Jul 20, 2021
@Mzack9999 Mzack9999 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jul 20, 2021
@Mzack9999 Mzack9999 linked a pull request Jul 21, 2021 that will close this issue
@ehsandeep
Copy link
Member

Hi @aerosayan, thanks for reporting this, High uses of memory was not intended as such we fixed this issue in linked PR.

@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Jul 22, 2021
@ehsandeep ehsandeep linked a pull request Jul 22, 2021 that will close this issue
@ehsandeep
Copy link
Member

A new release is pushed for mapCIDR including fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
3 participants