diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-20 23:58:38 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-20 23:58:38 (GMT) |
commit | 7bcabc60a36eb5910bd162d54ece449f5249bbcd (patch) | |
tree | cef5c71fedb71b1e9d24df5f58bded565ba1691d /Misc/README.valgrind | |
parent | 4aef41ffe7bee84f3b6440f4d76099cd030d058b (diff) | |
download | cpython-7bcabc60a36eb5910bd162d54ece449f5249bbcd.zip cpython-7bcabc60a36eb5910bd162d54ece449f5249bbcd.tar.gz cpython-7bcabc60a36eb5910bd162d54ece449f5249bbcd.tar.bz2 |
Fix a few more memory leaks
Document more info about the benefits of configuring without
pymalloc when running valgrind
Diffstat (limited to 'Misc/README.valgrind')
-rw-r--r-- | Misc/README.valgrind | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Misc/README.valgrind b/Misc/README.valgrind index 8e480e9..157bdc3 100644 --- a/Misc/README.valgrind +++ b/Misc/README.valgrind @@ -12,6 +12,19 @@ Misc/valgrind-python.supp. Second, you must do one of the following: * Uncomment the lines in Misc/valgrind-python.supp that suppress the warnings for PyObject_Free and PyObject_Realloc +If you want to use Valgrind more effectively and catch even more +memory leaks, you will need to configure python --without-pymalloc. +PyMalloc allocates a few blocks in big chunks and most object +allocations don't call malloc, they use chunks doled about by PyMalloc +from the big blocks. This means Valgrind can't detect +many allocations (and frees), except for those that are forwarded +to the system malloc. Note: configuring python --without-pymalloc +makes Python run much slower, especially when running under Valgrind. +You may need to run the tests in batches under Valgrind to keep +the memory usage down to allow the tests to complete. It seems to take +about 5 times longer to run --without-pymalloc. + + Details: -------- Python uses its own small-object allocation scheme on top of malloc, @@ -21,7 +34,8 @@ Valgrind may show some unexpected results when PyMalloc is used. Starting with Python 2.3, PyMalloc is used by default. You can disable PyMalloc when configuring python by adding the --without-pymalloc option. If you disable PyMalloc, most of the information in this document and -the supplied suppressions file will not be useful. +the supplied suppressions file will not be useful. As discussed above, +disabling PyMalloc can catch more problems. If you use valgrind on a default build of Python, you will see many errors like: |