You are not logged in.

#1 2005-01-11 07:38:01

vicious
Member
Registered: 2004-11-09
Posts: 113

MEMORY LEAKS

There have been a lot of leaks recently.

firefox, inkscape, mplayer.

Isn't this because of gtk 2.6?

Offline

#2 2005-01-11 12:02:12

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: MEMORY LEAKS

could be if you know a way of pin pointing it it i suggest filing a bug. I would definitley agree that the report of memeory leaks is way up lately.


AKA uknowme

I am not your friend

Offline

#3 2005-01-11 15:34:52

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: MEMORY LEAKS

sarah31 wrote:

could be if you know a way of pin pointing it it i suggest filing a bug. I would definitley agree that the report of memeory leaks is way up lately.

try running lint on some of the source... or maybe some memory profiling tools... I don't actually know of any beyond ccmalloc... anyone have good experience with any memory profilers?

edit:
valgrind looks very useful....
try running:

valgrind --tool=memcheck --leak-check=yes <program>

Offline

#4 2005-01-11 19:47:32

vicious
Member
Registered: 2004-11-09
Posts: 113

Re: MEMORY LEAKS

At least with inkscape memory profiles doesn't make any sense, because it uses a garbage collector.

However, I'm very curious why drawing an ellipse with inkscape leaks about 0,5MB of memory? That is very much!!!

Offline

#5 2005-01-11 20:11:10

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: MEMORY LEAKS

I've tried running valgrind on inkscape and it doesn't work (valgrind --tool=memcheck --leak-check=yes inkscape).

==6389== Process terminating with default action of signal 11 (SIGSEGV)
==6389==  Bad permissions for mapped region at address 0x52C00158
==6389==    at 0x1C535800: GC_mark_from (in /usr/lib/libgc.so.1.0.2)
==6389==    by 0x1C536FF4: GC_mark_some (in /usr/lib/libgc.so.1.0.2)
==6389==    by 0x1C52E09A: GC_stopped_mark (in /usr/lib/libgc.so.1.0.2)
==6389==    by 0x1C52EA53: GC_try_to_collect_inner (in /usr/lib/libgc.so.1.0.2)

Same error running as root. valgrind might need some special parameters.

Offline

#6 2005-01-12 00:15:12

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: MEMORY LEAKS

Almost everyone thats upgraded to gtk 2.6 has talked about having memory leak problems. If the leak is in a library used by a program will the profiler work?

Could it not be gtk 2.6 but another library that is common to all these apps?

Offline

#7 2005-01-12 00:24:48

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: MEMORY LEAKS

iBertus wrote:

If the leak is in a library used by a program will the profiler work?

I guess so. Check my screenshots in this thread (profiling pacman):
http://bbs.archlinux.org/viewtopic.php?t=9166
libc calls are also listed.

Actually.. those screenshots were made using the callgrind tool (in valgrind).. so.. you can say a profiler works. Leaks showed in that topic belong to pacman and they were spotted because valgring somehow hangs to "malloc"s to check when memory is allocated and runs the code inside somehow of virtual machine to see when/if it is freed (this might not be the best technical description, but I know that valgrind works).

I'm mostly using KDE apps + Firefox (rarely gqview, ethereal)... and I can't say I experience these problems.

Offline

#8 2005-01-12 02:50:10

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: MEMORY LEAKS

wtf IS a memory leak?

Offline

#9 2005-01-12 04:34:09

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: MEMORY LEAKS

dibblethewrecker wrote:

wtf IS a memory leak?

This is what programmers and other cool people call the sloppy allocation of memory by programs. When a program is "leaking" memory, it allocates memory but then fails to release it when finished. The result, which is very noticible with repeating processes, is a block of memory that becomes useless until it's reclaimed.

Back in Windows,  I once wrote a buggy piece of GDI code that leaked a few KB every time the use would refresh the graph (it was a graphic calculator app). Ahh, memories.

Offline

#10 2005-01-12 15:43:51

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: MEMORY LEAKS

dibblethewrecker wrote:

wtf IS a memory leak?

iBertus has it right... if you understand some basic C, here's an example:

void *p = malloc(1024); //allocate 1Kb of memory
p = NULL; //hooray, I don't have a p pointer anymore
          // so I can't call free(p) to release the memory

Offline

#11 2005-01-12 16:06:33

vicious
Member
Registered: 2004-11-09
Posts: 113

Re: MEMORY LEAKS

The interesting thing is that inkscape uses a garbage collector. So it should reclaim all the leaked memory sooner or later. The leak in gtk 2.6 must be more subtle (and undectable automatically). It must store a pointer to the leaked memory somewhere, but not use the pointer anymore and forget to delete it.

Offline

#12 2005-01-12 16:14:25

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: MEMORY LEAKS

vicious wrote:

The interesting thing is that inkscape uses a garbage collector. So it should reclaim all the leaked memory sooner or later. The leak in gtk 2.6 must be more subtle (and undectable automatically). It must store a pointer to the leaked memory somewhere, but not use the pointer anymore and forget to delete it.

good call, yeah if you're using some GC (which I never trust) you have to maintain a reference to that pointer in order to have it leak...

Offline

#13 2005-01-13 02:49:25

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: MEMORY LEAKS

cool - thanks guys smile

Offline

Board footer

Powered by FluxBB