Thread View: sci.math.num-analysis
1 messages
1 total messages
Started by Ira Ekhaus
Sat, 31 Oct 1992 20:03
Problem with malloc, heap space, unix and scientific C with dynamic allocation
Author: Ira Ekhaus
Date: Sat, 31 Oct 1992 20:03
Date: Sat, 31 Oct 1992 20:03
38 lines
2045 bytes
2045 bytes
Hello,
I'm doing some scientific programming where the emphasis has been
on the algorithm development and not on elegant, efficient use of memory.
Unfortunately my particular configuration of machine/UNIX
SparcII/SunOS Release 4.1.2 (GENERIC)
seems to cough when my total memory requests exceed ~ 500 K .
which seems ridiculous for a system with 32M of ram (see vmstat below ):
I should mention there are several other users who like to use matlab and hog
a bunch of memory.
unix% vmstat
procs memory page disk faults cpu
r b w avm fre re at pi po fr de sr d0 s1 s2 s3 in sy cs us sy id
1 0 0 0 24356 0 1 1 0 0 0 0 0 0 0 0 12 23 8 1 2 97
Currently, the approach I'm rewriting my own stuff to do goes as follows:
1) right at the start of my program I allocate a pointer with a few Mbytes.
2) Use my own alloc routine that just equates the pointer to a spot within
the memory of 1) and keep track of what I've reserved.
The disadvantage is that as far as the system is concerned, I've only allocated one big block.
So, I have no means of freeing a specific spot of memory without clearing out everything,
What combination of system configuration and malloc routines will robustly grab a few
Mbytes for my application and KEEP it?
I'd like the OS to keep track of the heap it possible.
thanks,
Ira
ekhaus@draper.com
Phone: 617 258 1109
Draper Laboratories m.s. 7c
555 Technology Square
Cambridge , MA
02139
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads