Ruby Script Tracking Memory Leaks

I created the Ruby XMPP Framework called babylon . Then I created several applications, and although they work quite smoothly, it seems that they are slowly eating up my computer memory.

I suspected leaks, so firstly, I added this at some point in my code:

puts `ps -o rss= -p #{Process.pid}`.to_i 

As expected, the output continued to grow ... slowly but surely.

I tried to find leaks using Dike, for example here .

Unfortunately, Dyke could not detect the leak. Even after it worked for quite some time, it still returns the same objects.

So, how can I be sure that my infrastructure is leaking, and not just take some RAM to a certain maximum point, and then start releasing it?

And then, how can I track leaks and fix them?

Thank you for your help!

+4
source share
1 answer

I have heard good things about the Ruby Memory Tracking API , but it is not free.

There is also a useful blog post using valgrind to find ruby ​​memory leaks.

There are other solutions for Ruby on Rails, but it looks like you don't use rails at all.

+1
source

All Articles