Modern gdb includes a Python, so you could use scripts for even more advanced things see links section below. You are commenting using your WordPress. You are commenting using your Google account. You are commenting using your Twitter account.
You are commenting using your Facebook account. Notify me of new comments via email. Notify me of new posts via email. This site uses Akismet to reduce spam.
Learn how your comment data is processed. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related 4. Hot Network Questions. Question feed. I have a buggy memory leaked software.
As an evidence, I have 1GB of core. Heap size is MB, so obviously, something allocates, but does not free the memory. However, this is hard to guess only with naked eyes, which object or struct is not freed. My idea to trace is, "Save gdb formatted output into a file, and run a pattern match to see which magic string comes up the most.
This will give you a plain binary dump int file result. You can also use the following to dump it in hex format:. Using the dump command is much clearer than using the gdb logging hack which even did not work for me somehow. Even if you could effectively "see magic string that comes up the most", you'll discover that you are leaking all the strings; but they are not the problem, leaking "v" is the problem. So what you really want is to build a graph of which allocated regions point to other allocated regions, and find a "root" of that graph.
This is nearly impossible to do by hand. So what is more likely to help you find the memory leak s? Fortunately, there are lots of tools that can solve this problem for you:.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.
0コメント