Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
We tried solving this by switching from active_model_serializers to blueprinter. Blueprinter was chosen because it uses less memory and is faster at turning data into JSON. This change immediately reduced the number of strings created and lowered the memory load.
-
If your choice of json seraliser makes the difference between running out of memory on the server or not, then the thing you're serialising must be absolutely hideous.
Whatever it is, you almost certainly don't need to serialise that bastard all in one go. -
Now for real. That's not usual behavior from trying to json.parse something too big.
You have a memory leak somewhere. As @Lensflare said, profile.
But it's most likely some unbounded cache behaving faulty.

I'm working on a project, and we ran into a problem where the server memory was getting used up way faster than before. At first, everything was fine because the server was restarting during releases, which cleared the memory. But over time, the situation got worse, and now it only runs for a few hours before crashing.
What can be done in this situation?
question
#bugfix
#memoryleak