Hi all,
        I have an application that is somewhat memory intensive.  The
problem is that the application seems to crash when trying to allocate some
additional memory for one of the vectors I'm using.  Anyway, does anyone
know the best way to monitor the amount of available memory on the palm
(memory used for variables, vectors, etc.).

        What I'm doing now to check free memory is the following:

 
        int card1 = MemNumRAMHeaps (0);
        int i;
        ULong temp;
        UInt HeapID;
        ULongPtr freeP, maxP;
        
        for(i=0;i<card1;i++)
        {
                HeapID = MemHeapID(0, i);
                temp = MemHeapSize(HeapID);
                MemHeapFreeBytes (HeapID,freeP, maxP);  
        }
        

        Basically I'm trying to determine the amount of free heap space on
any RAMHeaps on the first memory card.  I'm hoping this is where the
variables are stored.  The problem is, the freeP (the variable representing
the free memory) always seems to be rather large, even when I'm crashing.  I
suspect something in my algorithm is incorrect, so could someone let me know
the right way to find the total free memory?  Thanks!

David Korus
Blevins Enterprises Inc.

Reply via email to