From: "Seunghwan Ji" Newsgroups: comp.os.msdos.djgpp Subject: Exacltly when does actually DJGPP free allocated memory? Date: Thu, 1 Jul 1999 21:49:32 +0900 Organization: KT-Kornet Lines: 32 Message-ID: <7lfo40$jlu$1@news1.kornet.net> NNTP-Posting-Host: 210.113.220.61 X-Trace: news1.kornet.net 930833344 20158 210.113.220.61 (1 Jul 1999 12:49:04 GMT) X-Complaints-To: news AT news1 DOT kornet DOT net NNTP-Posting-Date: 1 Jul 1999 12:49:04 GMT X-Newsreader: Microsoft Outlook Express 4.72.3610.0100 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3610.0100 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, My new game program is using huge amount of memory for bitmap images and pcm wave files. The bmps and wavs are loaded from harddisk at the beginning of each main game period and freed after it. I use allegro library as image and sound programming engine. My problem is: As the game is running continuously without exiting to DOS (I mean the computer loads hundreds of megabytes bmps and waves and free them tens of times without exiting), the machine is getting slower and slower due to memory-disk swapping(I guess) and eventually die..! I tried to examine if the 'malloc - free' mechanism works fine or not by free memory amount check: _go32_dpmi_remaining_physical_memory(); _go32_dpmi_remaining_virtual_memory(): and I could not find free memory recovery after free command executed.. My question is: Exaclty when does actually DJGPP(or allegro) free allocated memory after free()? Is it after some minutes? Is it after special function calls? or Only after the program ends(exit to DOS)..? ....Please help me. S. Ji