Robert Kuska added the comment:

I tried leak2.py with valgrind, I've uncommented the lines you mentioned.

> $ valgrind python3 leak2.py                                                   
>                                                                               
>                                   
==28421== Memcheck, a memory error detector
==28421== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28421== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==28421== Command: python3 leak2.py
==28421== 
==28421== 
==28421== HEAP SUMMARY:
==28421==     in use at exit: 1,599,354 bytes in 11,594 blocks
==28421==   total heap usage: 284,971 allocs, 273,377 frees, 37,976,898 bytes 
allocated
==28421== 
==28421== LEAK SUMMARY:
==28421==    definitely lost: 0 bytes in 0 blocks
==28421==    indirectly lost: 0 bytes in 0 blocks
==28421==      possibly lost: 597,482 bytes in 2,319 blocks
==28421==    still reachable: 1,001,872 bytes in 9,275 blocks
==28421==         suppressed: 0 bytes in 0 blocks
==28421== Rerun with --leak-check=full to see details of leaked memory
==28421== 
==28421== For counts of detected and suppressed errors, rerun with: -v
==28421== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

I've removed `import readline` from leak2.py, everything else left as in 
previous run (also ofc removed tracemalloc).

> $ valgrind python3 leak3.py                                                   
>                                                                               
>                                  
==28515== Memcheck, a memory error detector
==28515== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28515== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==28515== Command: python3 leak2.py
==28515== 
==28515== 
==28515== HEAP SUMMARY:
==28515==     in use at exit: 1,599,384 bytes in 11,595 blocks
==28515==   total heap usage: 285,648 allocs, 274,053 frees, 38,126,379 bytes 
allocated
==28515== 
==28515== LEAK SUMMARY:
==28515==    definitely lost: 30 bytes in 1 blocks
==28515==    indirectly lost: 0 bytes in 0 blocks
==28515==      possibly lost: 597,375 bytes in 2,317 blocks
==28515==    still reachable: 1,001,979 bytes in 9,277 blocks
==28515==         suppressed: 0 bytes in 0 blocks
==28515== Rerun with --leak-check=full to see details of leaked memory
==28515== 
==28515== For counts of detected and suppressed errors, rerun with: -v
==28515== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Duh? Why does readline have this effect?

----------
Added file: http://bugs.python.org/file38684/leak3.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23769>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to