Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Memory leak/fragmentation using IanM`s queued load dll

Author
Message
slade
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location:
Posted: 6th Jul 2003 17:49
Im using ianm`s load queued item dll to load bitmaps into memory and after a while running (1hr+) windows will announce its expanding the swap file and then the program halts. Im loading a lot of files (at least one per second) so im wondering if either all the memory reserved for loading files is being given back to the system, or that the memory is becoming too fragmented because of all the memblocks being created/destroyed. I cant use the `load bitmap` function because this loads to a screen and i need it in workable memory, plus i want the .bmp header info available to read.

So basically:

Is there a memory leak/problem with the dll any1 else has found?
Would it be better to leave the memory block creation/destruction to the user manually rather than the dll doing it automatically, since im loading identical bitmaps each time i could reserve 1 memblock each time then just pass that pointer to the dll, something like below, or is there a better way of loading a bitmap without sending it to a screen first. DB really needs a BLOAD command like amos, so just BLOAD file$,ptr after 1st checking file size and reserving enough memory at `ptr`.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jul 2003 18:07 Edited at: 6th Jul 2003 18:07
It's you

Use the DELETE QUEUED ITEM to return memory to windows when you've loaded the data into a memblock and finished with it.

Still, over an hour huh? Not bad

If you don't need asynchronous loading, use something like the following function (typed directly in - untested):

slade
23
Years of Service
User Offline
Joined: 14th Feb 2003
Location:
Posted: 6th Jul 2003 18:55
Hehe ty, i cant believe you can load a file to a memblock like that, i couldent see it in the db help >.< I was releasing the memory each time though using your loader, i virtually copied your example code and just changed the filenames.

Login to post a reply

Server time is: 2026-07-17 13:57:40
Your offset time is: 2026-07-17 13:57:40