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 problem when convert mmdb to json #78

Open
Paper-Dragon opened this issue Oct 31, 2024 · 1 comment
Open

oom problem when convert mmdb to json #78

Paper-Dragon opened this issue Oct 31, 2024 · 1 comment

Comments

@Paper-Dragon
Copy link

This command uses up all my memory, is it possible to optimize it while converting every ip?

memory: 32G
command:

mmdbinspect -db GeoLite2-City.mmdb  0.0.0.0/0 >> GeoLite2-City.json
@oschwald
Copy link
Member

I believe the current implementation reads all of the data into memory before encoding it to JSON. I do agree that it would be better to stream the records to stdout as we read them. This is a bit harder to do with the Go JSON library as it doesn't have streaming functionality built in, but it does seem doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants