linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* out of memory
@ 2003-10-08 11:34 qhwang
  0 siblings, 0 replies; 10+ messages in thread
From: qhwang @ 2003-10-08 11:34 UTC (permalink / raw)
  To: linux-c-programming

Hi there,

Can anyone help me out of the mess? My program runs of out memory and then
is killed by the system. I use "top" to monitor its running and find out of
both RAM and SWAP. The "SIZE" option of "top" reaches more than 260 MB and
"RSS" more than 40 MB. Is this reasonable? The size of my program is just
over 100 KB. And the memory of my computer is just 64 MB and the swap is 256
MB. By the way, I find no memory leaks. Any suggestion will be greatly
appreaciated.

Bests,

QingHua.

P.S. I sent a post last night but I don't receive it this morning. So I post
it again.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: out of memory
@ 2003-10-08 12:44 Sandro Dangui
  2003-10-08 13:31 ` Mariano Moreyra
  0 siblings, 1 reply; 10+ messages in thread
From: Sandro Dangui @ 2003-10-08 12:44 UTC (permalink / raw)
  To: qhwang; +Cc: linux-c-programming


Then you have to send us the piece of code that contains this hungry loop.


-----Original Message-----
From: qhwang [mailto:qhwang@ieeta.pt] 
Sent: quarta-feira, 8 de outubro de 2003 09:36
To: Dangui, Sandro [CMPS:RY11:EXCH]
Cc: linux-c-programming@vger.kernel.org
Subject: Re: out of memory




> Do you have recursive calls?
> If you alloc all memory you need in the beginning, then the only 
> problem that I can figure is that you have an infinite recursive 
> call... or a loop between calls. It may be causing a stack overflow.

In my program there is a loop over 10k iteratives (image). In each loop
there are some kind of statistical learning algorithm running. It is killed
after it uses about 650 MB space (code + mainly data) with my laptop after
out of memory and swap.  I believe the problem lies inside the loop but
there should be no infinite loop because when I reduce the loop to over 1k
iteratives the program runs well. In this case it uses more 100 MB space.

I wonder where is this huge data space requirement coming from, since there
is no memory allocation inside the loop?



> BTW: You have problems with your e-mail:
It's very strange.

QingHua



^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <31E38B53D182D51195FA00508BE3A33402CE4C9B@zwnbc004.cala.nortel.com>]

end of thread, other threads:[~2003-10-09 11:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-08 11:34 out of memory qhwang
  -- strict thread matches above, loose matches on Subject: below --
2003-10-08 12:44 Sandro Dangui
2003-10-08 13:31 ` Mariano Moreyra
2003-10-08 13:38   ` Piyush Jain
     [not found] <31E38B53D182D51195FA00508BE3A33402CE4C9B@zwnbc004.cala.nortel.com>
2003-10-08 12:36 ` qhwang
2003-10-08 15:07 ` qhwang
2003-10-08 15:22   ` ronkhu
2003-10-08 16:31     ` qhwang
     [not found]       ` <1065630558.3f843b5e20715@www.correo.unam.mx>
2003-10-08 16:45         ` qhwang
2003-10-09 11:00     ` qhwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).