in reply to Perl Threads and Memory Leaking

This one's even uglier:

64bit jaunty 5.10.0 (5.10.0-19ubuntu1.1; most recent 'official' pkg) # -1 removed from the split in Beth' code #bash1 % perl ./x VIRT RES SHR S %CPU %MEM TIME+ 1000: 42796 8596 2048 S 0 0.2 0:02.80 2000: 47276 12m 2052 S 0 0.3 0:05.73 3000: 51708 17m 2052 S 0 0.4 0:08.69 4000: 56240 21m 2052 S 0 0.6 0:11.57 5000: 60704 25m 2052 S 0 0.7 0:14.65 6000: 65128 30m 2052 S 2 0.8 0:17.59 7000: 69636 34m 2052 S 0 0.9 0:20.69 8000: 74104 38m 2052 S 0 1.0 0:23.75 9000: 78556 43m 2052 S 0 1.1 0:26.89 10000: 83064 47m 2052 S 0 1.2 0:29.87 11000: 87564 52m 2052 S 0 1.3 0:32.92 12000: 92012 56m 2052 S 0 1.5 0:36.01 13000: 96540 60m 2052 S 0 1.6 0:39.11 14000: 98.7m 65m 2052 S 0 1.7 0:42.23 15000: 103m 69m 2052 S 0 1.8 0:45.49 16000: 107m 74m 2052 S 0 1.9 0:48.45 17000: 111m 78m 2052 S 0 2.0 0:51.40 18000: 116m 82m 2052 S 0 2.1 0:54.27 19000: 120m 87m 2052 S 0 2.2 0:57.23 20000: 124m 91m 2052 S 0 2.4 1:00.13 21000: 129m 95m 2052 S 0 2.5 1:03.08 22000: 133m 100m 2052 S 0 2.6 1:06.08 23000: 138m 104m 2052 S 0 2.7 1:09.07 24000: 142m 109m 2052 S 0 2.8 1:12.13 25000: 146m 113m 2052 S 0 2.9 1:15.17 26000: 151m 117m 2052 S 0 3.0 1:18.40 27000: 155m 122m 2052 S 0 3.1 1:21.46 28000: 159m 126m 2052 S 0 3.2 1:24.41 29000: 164m 130m 2052 S 0 3.4 1:27.35 30000: 168m 135m 2052 S 0 3.5 1:30.27 31000: 173m 139m 2052 S 0 3.6 1:33.16 32000: 177m 144m 2052 S 0 3.7 1:36.05 33000: 181m 148m 2052 S 0 3.8 1:38.94

Replies are listed 'Best First'.
Re^2: Perl Threads and Memory Leaking
by aphexcoil (Novice) on Oct 06, 2009 at 14:08 UTC
    Right. This is exactly what I saw originally on a Redhat server at work. I then took the code and ran it on two home servers (Linix Mint and Ubuntu). At first I thought it was some data structures that weren't being destroyed. This affected both v5.8.8, v5.10.0 and v5.10.1 I'll have to work around this problem and design the logic so that the threads never die. My program only uses three threads max (well four if you count the parent) -- but at the rate of creating and joining those threads every few seconds, the memory leak would eventually consume all available memory. I am curious if this is a bug -- I'd really like to know where that memory is going.