Questions tagged [objgraph]

objgraph is a module for creating and visualizing Python object graphs. It can be used as a tool for debugging memory leaks.

External links:

15 questions
16
votes
4 answers

Does Python GC deal with reference-cycles like this?

Using objgraph, I found a bunch of objects like this: Will Python's garbage collector deal with cycles like this, or will it leak? A slightly wider view of the loop:
dbr
  • 165,801
  • 69
  • 278
  • 343
14
votes
1 answer

Memory leak using pandas dataframe

I am using pandas.DataFrame in a multi-threaded code (actually a custom subclass of DataFrame called Sound). I have noticed that I have a memory leak, since the memory usage of my program augments gradually over 10mn, to finally reach ~100% of my…
sebpiq
  • 7,540
  • 9
  • 52
  • 69
12
votes
1 answer

diagnosing memory leak in python

I've been trying to debug a memory leak in the Coopr package using objgraph: https://gist.github.com/3855150 I have it pinned down to a _SetContainer object, but can't seem to figure out why that object is persisting in memory. Here's the result of…
Adam Greenhall
  • 4,818
  • 6
  • 30
  • 31
6
votes
2 answers

Image renderer (dot) not found, not doing anything else

I follow this doc: https://mg.pov.lt/objgraph/ objgraph_test.py: import objgraph import os x = ['a', '1', [2, 3]] filename = os.path.dirname(__file__) + '/objgraph_test.png' objgraph.show_refs([x], filename=filename) When I try to output a .png…
Lin Du
  • 88,126
  • 95
  • 281
  • 483
6
votes
1 answer

Leaking TarInfo objects

I have a Python utility that goes over a tar.xz file and processes each of the individual files. This is a 15MB compressed file, with 740MB of uncompressed data. On one specific server with very limited memory, the program crashes because it runs…
zmbq
  • 38,013
  • 14
  • 101
  • 171
5
votes
1 answer

Debugging a Python/NumPy memory leak

I am trying to find the origin of a nasty memory leak in a Python/NumPy program using C/Cython extensions and multiprocessing. Each subprocess processes a list of images, and for each of them sends the output array (which usually is about 200-300MB…
F.X.
  • 6,809
  • 3
  • 49
  • 71
4
votes
1 answer

Why can't objgraph capture the growth of np.array()?

See the code: import objgraph import numpy as np objgraph.show_growth() j = 20 y = [] for i in range(5): for l in range(j): y.append(np.array([np.random.randint(500),np.random.randint(500)])) print 'i:',i objgraph.show_growth() …
Jason
  • 169
  • 1
  • 11
2
votes
2 answers

Python multi-threaded application with memory leak from the thread-specific logger instances

I have a server subclass spawning threaded response handlers, the handlers in turn start application threads. Everything is going smoothly except when I use ObjGraph I see the correct number of application threads running ( I am load testing and…
Bill
  • 21
  • 1
  • 2
2
votes
1 answer

Interpreting objgraph numbers: memory leak?

I have a Python client-server application and its server has been running for about 4 days... Its memory usage (as reported by /proc/PID/status -> VmSize) has grown to about 660Mb, and I was wondering if there could be a memory leak, so I used…
Joril
  • 19,961
  • 13
  • 71
  • 88
2
votes
2 answers

Does it have memory leak?

I read objgraph document recently, and I confused about the following code >>> class MyBigFatObject(object): ... pass ... >>> def computate_something(_cache={}): ... _cache[42] = dict(foo=MyBigFatObject(), ... …
john2000
  • 75
  • 7
0
votes
0 answers

Understanding objgraph refs and memory leaks

I am trying to debug a pretty severe memory leak in python. The memory fills from ~500Mb on startup to 16Gb over a few iterations across 20 minutes. I have been using objgraph to plot references and backreferences. Some of the things I see I do…
matt
  • 45
  • 8
0
votes
0 answers

How do I get rid of variables clogging up memory in Python?

I wrote a chess engine in python and it eats up 13GB of RAM really quickly. I decreased the scale of the engine and used the objgraph library to check the size of data-structures created by the program. This is what is shown: Move …
Jetdr
  • 39
  • 2
0
votes
1 answer

Does any object tracked in Python GC have no referrer?

I planned to validate if my Python 3.6 code has any cyclic reference. Given an object, get_referrers https://docs.python.org/3/library/gc.html#gc.get_referrers returns all objects that refer to the object. However, the following returns [] [o for o…
Joe C
  • 2,757
  • 2
  • 26
  • 46
0
votes
0 answers

objgraph on osx: fix or alternatives

I need to visually inspect object dependencies in some python code to find a memory leak. I'm trying to use objgraph, but running into problems because one of its dependencies, xdot, requires gobject, and I can't find where to get it for osx. This…
LateCoder
  • 2,163
  • 4
  • 25
  • 44
0
votes
2 answers

Python GTK Memory allocation problems

Im actually trying to fix my memory problems within my python gtk app. Ive read many articles about memory usage in python but I cant get it all, so I hope you can help me here. So if I start my application and open the settings window, I have am…
HappyHacking
  • 878
  • 1
  • 12
  • 28