-
Notifications
You must be signed in to change notification settings - Fork 569
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 leak #107
Comments
Could you send over the response to a SERVER command? Also try to send the server a GC command. It's possible that Tile38 is hanging on to the memory a little longer than it needs to. Usually the memory is freed periodically or when the OS requests for it. |
@tidwall GC did not change the memory acquired (neither res, not virt according to top). |
Here is it. Currently after ingestion initial consumtion increased from 200MB to 577 MB. Then I have stopped ingestion (otherwise it will grow more, up to 10G RAM as I saw in experiment yesterday):
|
@amorskoy This information is very useful. I'm going to try to reproduce the problem on my side and I have a few questions.
From the SERVER data you provided, I see the 23,198 objects -> 23,198 hooks, but what about the point objects that you are creating 2x per sec with the SET command? Are you sending a DEL command to remove them? Roughly how much time has elapsed before the Tile38 instance has grown to 10GB? Is the point insertion a steady 2x per sec during that duration? About how many Enter hook notifications fire during that time? Thanks for you help with this. |
@tidwall no, it is not DEL - I am using SET.... EX 5 instead Grow from 200 MB to 10GB ~ in 5 mins. |
I'm still investigating, but I haven't been able to reproduce the leak yet. I've tried thousands of hooks and hundred of thousands of points (using I may be wrong but perhaps the memory isn't leaking. Rather Tile38 is notifying the OS to reclaim unused memory and Linux is like "thanks. I don't need it right now, but I'll grab it later". Then it resides with the Tile38 process until the OS reclaims it. Here's more info on the topic: I'm wondering if this is happening in your case. I added the new If you don't mind trying out the Please let me know you thoughts on this and I'll keep investigating. Thanks! |
@tidwall Thanks - sure I will. I hope to find a free time slot for this as soon as possible. |
@tidwall just finished experiment with So:
|
P.s. if I kill and start tile38 (so AOF is loaded) - mem is at initial volume 200MB again |
Good info. Could you also execute the GC command after full ingestion? Then send over the SERVER response before and after GC? |
Ok - I will try to make it asap |
Btw, another interesting thing: before the ingestion, I just launched SERVER command, with the 1 minute delay between commands:
You can see that heap incresed - but nothing was sent to Tile38 server in fact |
And after 3 minutes i see that heap is released - so probably it is ok: |
Ok, so repeating the experiment
So we have 2 issues: |
Yes, there is a leak. :( After (6), the If allowable, could you to share the SETHOOK and SET EX commands? Perhaps a gzipped AOF file should be enough. I want to set up the identical Linux environment and pump the same data through. Hopefully I can resolve this in short order. |
@tidwall sure - during nearest workday I will try to figure out what could be extracted - and will share |
@tidwall here is zipped AOF. Please let me know if you need something else. Thanks |
I just pushed an update that I believe fixes the leak. There're also a few other optimizations thrown in. Please check it on your side and let me know if this works for you. Also I created a utility for this specific issue located in the
It prints memory status info every second to a log file in the format:
Every second the test application send the server a In the previous commit b8a0f59 the log looked like:
Please take it for a spin and let me know if you have any questions. Thanks! |
Great! Ok - nearest workday (it is GMT+2 + dst) I will start with this issue and let you know ASAP @tidwall |
@tidwall Great results.
@tidwall please feel free to close the ticket - cool result! |
I just pushed these changes to the master branch. Let me know if you run into problems along the way. Thanks! |
I have ~ 23K objects of multipolygon type, representing California boundies.
Enter hook assigned for each poligon --> ~ 23K web hooks
When I am starting point insertion with SET commands (2 points per second) I see that memory, consumed by tile38 server grows from initial 200MB to 700MB (and it will grow if I continue ingestion).
The bad thing is that after I stop ingestion - memory is not freed.
When I am restarting Tile38 - AOF is reloaded and initial memory is again 200MB
p.s. working with master branch
The text was updated successfully, but these errors were encountered: