BBC BASIC for Windows
Programming >> BBC BASIC language >> Irretrievable loss of physical RAM http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1251960049 Irretrievable loss of physical RAM
Post by 19Grumpah42 on Sep 3rd, 2009, 06:40am
As my programme grows, I find that RUNning it now consumes around 200 MB of physical RAM. And I do not get it back when I close BBC-Basic! I use "Smart RAM" to monitor and scavenge free RAM, and it barely touches this extra consumption. I have 2 GBy RAM (normally runs with > 900 MB free under Win XPsp3 with 5 molecular dynamics [not BBC-Basic!] running) and 4 GB swapfile (around 1.5 GB in use). I now have INSTALLed WINLIB3, D3DLIB, MDILIB. Could these be the culprits? I am largely ignorant of how Win XP uses its memory, does anybody have any suggestions? Is this to be expected? --Grahame > Re: Irretrievable loss of physical RAM
Post by admin on Sep 3rd, 2009, 08:19am
Quote:
As my programme grows, I find that RUNning it now consumes around 200 MB of physical RAM. And I do not get it back when I close BBC-Basic!
The 'normal' memory used by BBC BASIC programs (i.e. the program itself, the heap, the stack, libraries etc.) is automatically freed on exit, so you should not be seeing any 'cumulative' use of memory unless your program is making calls to Windows memory-allocation API functions (such as SYS "GlobalAlloc").
Quote:
I now have INSTALLed WINLIB3, D3DLIB, MDILIB. Could these be the culprits?
Neither WINLIB3 nor MDILIB make any memory-allocation calls, so they shouldn't be responsible. D3DLIB doesn't do any explicit memory allocation, but Direct3D is a complex sub-system and it is entirely possible that memory may be used inappropriately if (for example) your program doesn't properly call PROC_release(). Make sure your program has the necessary ON ERROR and ON CLOSE statements so that all Direct3D resources are freed on exit.
Quote:
I use "Smart RAM" to monitor and scavenge free RAM
If this is a third-party (non-Microsoft) application I would recommend that you try your program(s) on a PC that does not have "Smart RAM" installed to see if it makes a difference.