Re: Memory management
- From: Anders Selander <selander pdc kth se>
- To: orbit-list gnome org
- Subject: Re: Memory management
- Date: Thu, 19 Dec 2002 18:17:57 +0100
Sam Couter <sam@couter.dropbear.id.au> wrote:
> > However, when I run the code at the target system, a IBM-SP node running
> > AIX, with ORBit installed from the source tar-ball, the memory is not
> > returned.
> What do you mean by "not returned"?
Returned to the system, for any process to use.
> Some systems are incapable of
> shrinking the heap once it's been allocated, so the process size won't
> shrink back to its original size. That memory is still free and
> available for malloc() and friends to allocate from though.
AIX is obviously one of those. Kind of make sense to keep the heap size
at the highwater-mark, if you believe it is sure to be needed again soon.
However, there are ways around it (if you manage your memory yourself
and do not use ORBit's functions, that is). For instance, you can
mmap /dev/zero, use the returning pointer as a pointer to any buffer,
unmap it when you are done, and the heap-size will be unaffected. ;-)
Anyway, thanks for the input and the suggested test program. I got rid
of the (never existing) memory-leak and got wiser in the process.
Merry Christmas /Selander
--
Anders Selander Centre for Parallel Computers selander@pdc.kth.se
Programmer Royal Institute of Technology +46 (0)8 790 72 11
SE-100 44 STOCKHOLM, SWEDEN +46 (0)70 266 29 67
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]