Ticket #485 (new task)
tweak GC
| Reported by: | quinox | Owned by: | quinox |
|---|---|---|---|
| Priority: | normal | Milestone: | Release 1.2.14 |
| Component: | nicotine | Version: | 1.2.13 |
| Keywords: | Cc: |
Description
last time I debugged I didn't find any leaks, but it seems the Python GC doesn't run often enough or something. Maybe we can add a 15-minute timer to force the collection.
Reference material:
http://guppy-pe.sourceforge.net/ http://nedbatchelder.com/blog/200809/a_server_memory_leak.html http://code.google.com/p/pympler/
Attachments
Change History
comment:2 Changed 2 years ago by quinox
It seems it's more fundamental that CG. At startup:
12:07:32 24773 7.00 0.00 446264 71464 1.77 nicotine 12:07:47 24773 3.87 0.00 446264 71296 1.76 nicotine 12:08:02 24773 1.60 0.07 446264 61296 1.52 nicotine 12:08:17 24773 3.47 1.07 446264 60700 1.50 nicotine 12:08:32 24773 4.80 0.80 446264 60904 1.51 nicotine 12:08:47 24773 0.07 0.00 446264 60904 1.51 nicotine 12:09:02 24773 0.27 0.00 446264 60904 1.51 nicotine 12:09:17 24773 2.00 0.00 446264 60904 1.51 nicotine 12:09:32 24773 0.47 0.00 446264 60904 1.51 nicotine
then it stays around 1.51% for a long time. Then right when I open up filelists (either remote or local) it explodes:
13:56:47 24773 210.07 0.00 554964 117040 2.90 nicotine 13:57:02 24773 420.93 0.00 554964 117040 2.90 nicotine 13:57:17 24773 514.80 0.00 573640 135612 3.35 nicotine 13:57:32 24773 25.73 0.00 575092 137112 3.39 nicotine 13:57:47 24773 0.00 0.00 575092 137112 3.39 nicotine 13:58:02 24773 0.00 0.00 575092 137112 3.39 nicotine 13:58:17 24773 0.00 0.00 575092 137112 3.39 nicotine 13:58:32 24773 106.87 0.00 589724 143488 3.55 nicotine 13:58:47 24773 102.80 0.00 595868 149632 3.70 nicotine 13:59:02 24773 0.07 0.00 587672 149628 3.70 nicotine 13:59:17 24773 0.00 0.00 587672 149628 3.70 nicotine
And it never goes down, even after forcing the CG it stays at 3.7%
comment:3 Changed 2 years ago by quinox
After opening and closing 61 filelists:
14:10:48 28725 0.47 0.00 976508 636324 15.74 nicotine
Heapy reports the diff. in memory:
Partition of a set of 767 objects. Total size = 117832 bytes.
Index Count % Size % Cumulative % Kind (class / dict of class)
0 234 31 33992 29 33992 29 str
1 7 1 23464 20 57456 49 dict of pynicotine.transfers.Transfer
2 140 18 10760 9 68216 58 tuple
3 100 13 9600 8 77816 66 time.struct_time
4 14 2 3920 3 81736 69 dict of 0x7f89befee8c0
5 29 4 3304 3 85040 72 list
6 3 0 3144 3 88184 75 dict of pynicotine.pynicotine.PeerConnection
7 3 0 3144 3 91328 78 dict of threading._Timer
8 10 1 2800 2 94128 80 dict of pynicotine.pynicotine.UserAddr
9 9 1 2520 2 96648 82 dict (no owner)
So it seems we're not leaking any python objects. The memory usage doesn't go up evenly with the amount of filelists we open either.

I've added a Bash script to the SVN ( here) to track memory usage.