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

Memory Requirement for large json file #1858

Closed
harajyotidas opened this issue Dec 2, 2019 · 2 comments
Closed

Memory Requirement for large json file #1858

harajyotidas opened this issue Dec 2, 2019 · 2 comments
Labels
kind: question state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@harajyotidas
Copy link

  • Describe what you want to achieve.
    I am evaluating the memory requirements for big json file. The size of the json file(normal json file) is 68 mb. After parsing, I see that the application takes around 1GB of memory. Why is it taking so much of memory?

  • Describe what you tried.

std::ifstream i("project.json", std::ifstream::in);
json j;
i >> j;
  • Describe which system (OS, compiler) you are using.
    windows 10/64 bit/I7 processor/16GB RAM

  • Describe which version of the library you are using (release version, develop branch).
    latest release version

@nlohmann
Copy link
Owner

nlohmann commented Dec 2, 2019

This depends on the JSON value. Can you share it?

The library uses at least 64 bit per value (number, bool, null), and pointers to std::string, std::map, std::vector for strings, objects, and arrays, respectively. You can use the SAX interface if you do not want a DOM parser.

@stale
Copy link

stale bot commented Jan 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Jan 1, 2020
@stale stale bot closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

2 participants