|
From: <Hul...@em...> - 2008-01-31 19:09:19
|
I would like to know whether I can detect when my application can not allocate more memory when it calls malloc() or some such memory allocation function. This condition typically happens when the System (on which my application is run) is running out of memory. Can Valgrind tool detect such a condition of insufficient memory? (If so, I guess I need to link my application with Valgrind library, correct?) I searched FAQ section, but did not find answer to this type of question. Thanks. |
|
From: Nicholas N. <nj...@cs...> - 2008-02-01 00:19:03
|
On Thu, 31 Jan 2008 Hul...@em... wrote: > I would like to know whether I can detect when my application can not > allocate more memory when it calls malloc() or some such memory > allocation function. This condition typically happens when the System > (on which my application is run) is running out of memory. Can Valgrind > tool detect such a condition of insufficient memory? (If so, I guess I > need to link my application with Valgrind library, correct?) I searched > FAQ section, but did not find answer to this type of question. Thanks. Valgrind cannot do this, sorry. Nick |
|
From: <Hul...@em...> - 2008-02-01 05:12:34
|
Thanks a lot, Nick. I appreciate your quick reply. Best Regards...Vish=20 -----Original Message----- From: Nicholas Nethercote [mailto:nj...@cs...]=20 Sent: Thursday, January 31, 2008 4:16 PM To: Hulikal, Vishvanath Cc: val...@li...; Scott, Bill Subject: Re: [Valgrind-users] Out-of-memory or insufficent memory condition On Thu, 31 Jan 2008 Hul...@em... wrote: > I would like to know whether I can detect when my application can not > allocate more memory when it calls malloc() or some such memory > allocation function. This condition typically happens when the System > (on which my application is run) is running out of memory. Can Valgrind > tool detect such a condition of insufficient memory? (If so, I guess I > need to link my application with Valgrind library, correct?) I searched > FAQ section, but did not find answer to this type of question. Thanks. Valgrind cannot do this, sorry. Nick |
|
From: Tim G. <tg...@sh...> - 2008-02-01 06:11:49
|
Doesn't malloc() return NULL when it cannot allocate the memory requested? Is testing for this too coarse for your application? -- Tim Gruene Institut fuer anorganische Chemie Tammannstr. 4 D-37077 Goettingen GPG Key ID = A46BEE1A On Thu, 31 Jan 2008, Hul...@em... wrote: > I would like to know whether I can detect when my application can not > allocate more memory when it calls malloc() or some such memory > allocation function. This condition typically happens when the System > (on which my application is run) is running out of memory. Can Valgrind > tool detect such a condition of insufficient memory? (If so, I guess I > need to link my application with Valgrind library, correct?) I searched > FAQ section, but did not find answer to this type of question. Thanks. > > |
|
From: <Hul...@em...> - 2008-02-04 15:58:06
|
Thanks Cerion. Vish -----Original Message----- From: Cerion Armour-Brown [mailto:ce...@op...]=20 Sent: Saturday, February 02, 2008 5:59 AM To: val...@li... Cc: Hulikal, Vishvanath; Scott, Bill Subject: Re: [Valgrind-users] Out-of-memory or insufficent memory condition By default, malloc will essentially always succeed. If you need to know at=20 malloc request time if there's really enough memory, you need to change=20 the "overcommit_memory" setting in /proc/sys/vm/. Cerion On Friday 01 Feb 2008, Tim Gruene wrote: > Doesn't malloc() return NULL when it cannot allocate the memory requested? > Is testing for this too coarse for your application? > > > -- > Tim Gruene > Institut fuer anorganische Chemie > Tammannstr. 4 > D-37077 Goettingen > > GPG Key ID =3D A46BEE1A > > On Thu, 31 Jan 2008, Hul...@em... wrote: > > I would like to know whether I can detect when my application can not > > allocate more memory when it calls malloc() or some such memory > > allocation function. This condition typically happens when the System > > (on which my application is run) is running out of memory. Can Valgrind > > tool detect such a condition of insufficient memory? (If so, I guess I > > need to link my application with Valgrind library, correct?) I searched > > FAQ section, but did not find answer to this type of question. Thanks. > > ------------------------------------------------------------------------ - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |