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
ujson uses 30% memory compared to json, even after load complete #333
Comments
This may be related to #254 (comment) |
This is a memory leak: explosion/srsly#4 |
Note: explosion/srsly#4 was fixed by PR explosion/srsly#5 which is a port of PR #270, not yet fully merged. |
Although it would be good to retest with 2.0.0 to see if the merged subsets of #270 have fixed this particular issue. |
ujson version 2.0.3 maybe still have the problem of memory leak. I test ujson version 2.0.3 ,here is script in container gnocchi-api:
import ujson
print ujson.__version__ # 2.0.3
while True:
with open('test.json') as infile:
data = ujson.load(infile) And i found memory leak maybe stall exist; the memory usage of gnocchi-api before test when testing Interrupt program; see that there are still 68M of memory that have not been released; but when i use Is there anything wrong with my test method? Any body help? |
#270 and colleagues addressed leaks during encoding, not decoding. I don't see any relevant commits that might have changed anything on decoding. |
Still relevant for While I don't have an exact number, it is around 20-30% as the original OP commented. |
In an extremely simple test of loading a 140 MB JSON file, ujson ends up with 30% higher memory usage even after loading has happened.
Both built-in json and simplejson uses exactly the same amount of memory: 992 MB
ujson on the other hand uses: 1314 MB
Test is super simple, like:
And I check in htop's RES column for the memory usage. It's the same as macOS's Activity Monitor's memory column.
The text was updated successfully, but these errors were encountered: