linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: help on memory problem
@ 2003-10-07 22:57 Sandro Dangui
  2003-10-08  7:26 ` ronkhu
  0 siblings, 1 reply; 3+ messages in thread
From: Sandro Dangui @ 2003-10-07 22:57 UTC (permalink / raw)
  To: qhwang, linux-c-programming


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.


-----Original Message-----
From: qhwang [mailto:qhwang@ieeta.pt] 
Sent: terça-feira, 7 de outubro de 2003 19:43
To: linux-c-programming@vger.kernel.org
Subject: help on memory problem


Hi there,

Can anyone help me to get out of the mess, please? I am writing a program
which tries to detect faces inside an image. For further comparison, now I
use the "brutal force search" strategy which means there is a  window (here
32x32) scanning the input image (e.g., 160x120) pixel by pixel.  The problem
is, this "brutal forace search" uses quite a lot memory and it's always
killed by the system after running a while. At first I think there are some
memory leaks but I could not find any when I set the macro MALLOC_CHECK_=1.
I also modify the code to make sure all the data structure are only
allocated once, e.g., in the main program, but the problem is still there.
When I use "top" to monitor the memory infor when the program is running and
find that the option "SIZE" reaches more than 250 MB and "RSS" reaches 40
MB. My program is only about 110 KB. The memory of my computer is only 64 MB
but with my laptop (256 MB) the problem is same. Can anybody give me some
pointers about it?

Many thanks.

QingHua

-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread
* help on memory problem
@ 2003-10-07 22:43 qhwang
  0 siblings, 0 replies; 3+ messages in thread
From: qhwang @ 2003-10-07 22:43 UTC (permalink / raw)
  To: linux-c-programming

Hi there,

Can anyone help me to get out of the mess, please? I am writing a program
which tries to detect faces inside an image. For further comparison, now I
use the "brutal force search" strategy which means there is a  window (here
32x32) scanning the input image (e.g., 160x120) pixel by pixel.  The problem
is, this "brutal forace search" uses quite a lot memory and it's always
killed by the system after running a while. At first I think there are some
memory leaks but I could not find any when I set the macro MALLOC_CHECK_=1.
I also modify the code to make sure all the data structure are only
allocated once, e.g., in the main program, but the problem is still there.
When I use "top" to monitor the memory infor when the program is running and
find that the option "SIZE" reaches more than 250 MB and "RSS" reaches 40
MB. My program is only about 110 KB. The memory of my computer is only 64 MB
but with my laptop (256 MB) the problem is same. Can anybody give me some
pointers about it?

Many thanks.

QingHua


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-08  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 22:57 help on memory problem Sandro Dangui
2003-10-08  7:26 ` ronkhu
  -- strict thread matches above, loose matches on Subject: below --
2003-10-07 22:43 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).