Posted this in Ortu's game thread, but not maybe everyone checks that...sooo
More obsessive memory monitoring has led me to this discovery...
I was testing some new code and an important email came in, I minimized the test to check the email
Before I minimized the DBP Window, I was at 30MB memory used. (Ortu got me freaked out about mem leaks so I always check!
)
After restoring the window...imagine my surprise when I was at 4MB memory used! Ran about my level and it didn't grow back up to the initial 30MB, it stayed at round 4MB....
Weird right! So I added some test code at the end of the main loop.
mainloop=1
Do
// do my game code here
Sync
//Then add the magic memory reducer at the end of the main loop
if mainloop=1
minimize window
restore window
mainloop=2 //only execute once.
endif
LOOP
Works every time! Reducing the initial memory by almost 80%! (for me)
What kind of Voodoo is this?
Continued...
Placement of the magic code seems to matter, at the very end of the loop AFTER the sync, I get 80% memory savings. 30 mb to 4 mb
At the start of the main loop, I still save some memory, 30MB down to 9MB (so 2/3 of the memory I save)
So, if we can find another DBP command that does the same thing without minimizing/restoring the window....
Or if whatever windows DLL DBP is calling for min/restore window, but only use the parts that free the memory, we can call only those parts.
I'm not a DLL master, so any help figuring this out is appreciated.