From: <Pat...@no...> - 2009-05-14 20:55:16
|
Hi, I am using valgrind 3.4.1 to try to find a memory leak. My program has an initial routine which allocates a lot of memory - around 1 GB. When I run the program by itself it runs fine, however when I run it under valgrind, one of the many malloc calls in the initial routine fails. Does anyone know why this would happen? There is plenty of memory on the machine (64 GB). Patrick |
From: tom f. <tf...@al...> - 2009-05-14 21:03:50
|
Pat...@no... writes: > I am using valgrind 3.4.1 to try to find a memory leak. My > program has an initial routine which allocates a lot of memory - > around 1 GB. When I run the program by itself it runs fine, however > when I run it under valgrind, one of the many malloc calls in > the initial routine fails. > > Does anyone know why this would happen? There is plenty of memory > on the machine (64 GB). Are you running in 32bit mode? Make sure you're passing -m64 when compiling with gcc. -tom |
From: Patrick A. <pat...@no...> - 2009-05-14 22:00:40
|
It is a 64 bit machine, and I reinstalled valgrind using --enable-only64bit, and it did use the -m64 when compiling. Unfortunately I get the same malloc failure as before. Patrick On Thu, May 14, 2009 at 03:03:37PM -0600, tom fogal wrote: > Pat...@no... writes: > > I am using valgrind 3.4.1 to try to find a memory leak. My > > program has an initial routine which allocates a lot of memory - > > around 1 GB. When I run the program by itself it runs fine, however > > when I run it under valgrind, one of the many malloc calls in > > the initial routine fails. > > > > Does anyone know why this would happen? There is plenty of memory > > on the machine (64 GB). > > Are you running in 32bit mode? Make sure you're passing -m64 when > compiling with gcc. > > -tom > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |
From: tom f. <tf...@al...> - 2009-05-15 01:15:21
|
Patrick Alken <pat...@no...> writes: > It is a 64 bit machine, and I reinstalled valgrind using > --enable-only64bit, and it did use the -m64 when compiling. I meant compiling the *app* 64bit. e.g. if you're running: valgrind --whatever ./a.out then you should get a.out via: gcc -blah -m64 -moreblah something.c you can also check if the binary under test is 64bit with `file'. -tom > Patrick > > On Thu, May 14, 2009 at 03:03:37PM -0600, tom fogal wrote: > > Pat...@no... writes: > > > I am using valgrind 3.4.1 to try to find a memory leak. My > > > program has an initial routine which allocates a lot of memory - > > > around 1 GB. When I run the program by itself it runs fine, however > > > when I run it under valgrind, one of the many malloc calls in > > > the initial routine fails. > > > > > > Does anyone know why this would happen? There is plenty of memory > > > on the machine (64 GB). > > > > Are you running in 32bit mode? Make sure you're passing -m64 when > > compiling with gcc. > > > > -tom > > > > --------------------------------------------------------------------------- > --- > > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > > production scanning environment may not be a perfect world - but thanks to > > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i7 > 00 > > Series Scanner you'll get full speed at 300 dpi even with all image > > processing features enabled. http://p.sf.net/sfu/kodak-com > > _______________________________________________ > > Valgrind-users mailing list > > Val...@li... > > https://lists.sourceforge.net/lists/listinfo/valgrind-users |
From: Patrick A. <pat...@no...> - 2009-05-15 17:26:04
|
file says: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped so it looks like everything is properly 64 bit compiled. I also tried putting in -m64 explicitly. Patrick On Thu, May 14, 2009 at 07:15:12PM -0600, tom fogal wrote: > Patrick Alken <pat...@no...> writes: > > It is a 64 bit machine, and I reinstalled valgrind using > > --enable-only64bit, and it did use the -m64 when compiling. > > I meant compiling the *app* 64bit. e.g. if you're running: > > valgrind --whatever ./a.out > > then you should get a.out via: > > gcc -blah -m64 -moreblah something.c > > you can also check if the binary under test is 64bit with `file'. > > -tom > > > Patrick > > > > On Thu, May 14, 2009 at 03:03:37PM -0600, tom fogal wrote: > > > Pat...@no... writes: > > > > I am using valgrind 3.4.1 to try to find a memory leak. My > > > > program has an initial routine which allocates a lot of memory - > > > > around 1 GB. When I run the program by itself it runs fine, however > > > > when I run it under valgrind, one of the many malloc calls in > > > > the initial routine fails. > > > > > > > > Does anyone know why this would happen? There is plenty of memory > > > > on the machine (64 GB). > > > > > > Are you running in 32bit mode? Make sure you're passing -m64 when > > > compiling with gcc. > > > > > > -tom > > > > > > --------------------------------------------------------------------------- > > --- > > > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > > > production scanning environment may not be a perfect world - but thanks to > > > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i7 > > 00 > > > Series Scanner you'll get full speed at 300 dpi even with all image > > > processing features enabled. http://p.sf.net/sfu/kodak-com > > > _______________________________________________ > > > Valgrind-users mailing list > > > Val...@li... > > > https://lists.sourceforge.net/lists/listinfo/valgrind-users |
From: Colin M. <col...@pi...> - 2009-05-18 10:27:21
|
tom fogal wrote: > Pat...@no... writes: > >> I am using valgrind 3.4.1 to try to find a memory leak. My >> program has an initial routine which allocates a lot of memory - >> around 1 GB. When I run the program by itself it runs fine, however >> when I run it under valgrind, one of the many malloc calls in >> the initial routine fails. >> >> Does anyone know why this would happen? There is plenty of memory >> on the machine (64 GB). >> > > How much is valgrind's over heads? IIRC, it's a little over 1.125 bytes per byte allocated by the program. Could it be they exceed the system's free memory? Is there anything logged to syslog about this. Col. |
From: Ivan N. <nov...@gm...> - 2009-05-14 21:06:07
|
is it a 32 bit or 64 bit OS? On Thu, May 14, 2009 at 1:55 PM, <Pat...@no...> wrote: > Hi, > > I am using valgrind 3.4.1 to try to find a memory leak. My > program has an initial routine which allocates a lot of memory - > around 1 GB. When I run the program by itself it runs fine, however > when I run it under valgrind, one of the many malloc calls in > the initial routine fails. > > Does anyone know why this would happen? There is plenty of memory > on the machine (64 GB). > > Patrick > > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
From: Nicholas N. <n.n...@gm...> - 2009-05-15 21:17:01
|
On Fri, May 15, 2009 at 6:55 AM, <Pat...@no...> wrote: > > I am using valgrind 3.4.1 to try to find a memory leak. My > program has an initial routine which allocates a lot of memory - > around 1 GB. When I run the program by itself it runs fine, however > when I run it under valgrind, one of the many malloc calls in > the initial routine fails. > > Does anyone know why this would happen? There is plenty of memory > on the machine (64 GB). On my x86-64 machine, which has 4GB of RAM, I tested with a trivial program and was able to malloc up to 8GB successfully. A 9GB allocation failed. So it's not some limit in Valgrind's malloc implementation; I don't know what the problem is. Nick |