IPAS memory use?
6 messages in this thread
I'm going to investigate this further, but I thought I'd make an early request,
too…
What sorts of program activity will cause an unreasonable number of page
faults? I don't want my IPAS routine to throw 3DS / Pharlap into a
page-swapping frenzy. Apparently my first batch of IPAs file format
translators do just that.
At this time, I have a memory allocating wrapper function (for portability)
that's just calling Metaware's 'malloc()' function. My translator might end up
making thousands of small requests for relatively small amounts of memory,
total of about 2-3 megs for a typical translation, in pieces ranging from
several hundred K in size to tinier pieces of just a dozen or two bytes. And
some of those might be due to realloc()-style calls.
Allocating more memory than is physically available will cause page
faults, but you knew that.
IPAS routines are really second programs running at the same time as
3D Studio. The problem is not unlike running AA Pro from a Dos
Window. If 3D Studio has already used up the physical memory before
running your IPAS routine, then any memory allocation from your
routine will result in a page fault.
To minimize page faults while your routine is running, you may want to
set your maxdata linker setting up to the expected memory usage, as
this will increase the amount of heap upon loading and get the all
the page faults out of the way in the beginning. You may also want
to cfig386 3DS.EXE -maxdata xxxxxxx to keep 3DS from gobbling up all
the free memory.
I don't think my routine was trying to allocate more memory than physical
memory was available. My maxdata was set to zero, like the examples. (I'd never
looked into what it was used for.) The beta tester's 3DS Current Status Report
looks like this:
Memory (K Bytes)
Available: 30,972 Used: 696 Swap File: 257984 Page Faults:
1067316
You must mean '-maxreal' for the 'cfig386' program, not 'maxdata' the linker
option. I thought 'maxdata' only applied to conventional (below 640K) memory?
What does this have to do with IPAS? Or did you mean -extlow and -exthigh,
which will lead to even more questions from me. 🙂
I am not familiar with the constraints of running things from the DOS shell.
I've got a 16 meg machine with the default settings for 'cfig386'.
John,
When you are making calls to malloc and realloc, are you also calling free?
I have found with some of my routines, I'll use 16m RAM and swap 30m+, but if I
call free on ALL of the variables that I can after using them in each
subroutine that I do not use *ANY* extra available memory. Meaning that a
check of the current stats shows no extra memory usage! Don't know if this
helps…
Later,
doug