Author Topic: Out Of Heap - DosBox vs ScummVM  (Read 3688 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Out Of Heap - DosBox vs ScummVM
« on: January 02, 2021, 01:26:44 PM »
I'm working on an SCI1.1 game and I'm running out of heap.  In my testing I tried using DosBox and ScummVM and I found that upon starting up the game and immediately going into the debugger and viewing the available heap (alt-d, alt-r) there are differences.

In DosBox, I have 10040 bytes free.  In ScummVM, I have 32746 bytes free.  Does someone here have an explanation as to why this would be? 


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline troflip

Re: Out Of Heap - DosBox vs ScummVM
« Reply #1 on: January 02, 2021, 01:54:15 PM »
If I recall correctly, in ScummVM each script has its own 64KB segment on the heap, and any new objects you create are put on a separate 64KB segment too. So I don't think you can tell too much from asking how much free heap there is in ScummVM.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline troflip

Re: Out Of Heap - DosBox vs ScummVM
« Reply #2 on: January 02, 2021, 01:58:39 PM »
And actually it looks like ScummVM just returns a hardcoded number:
https://github.com/scummvm/scummvm/blob/4a7248627906ca34a45118d65bd0e51656f6421c/engines/sci/engine/kmisc.cpp

0x7fea (or decimal 32746)
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline gumby

Re: Out Of Heap - DosBox vs ScummVM
« Reply #3 on: January 02, 2021, 02:04:08 PM »
If I recall correctly, in ScummVM each script has its own 64KB segment on the heap, and any new objects you create are put on a separate 64KB segment too. So I don't think you can tell too much from asking how much free heap there is in ScummVM.

So it sounds like for my circumstance, I'm better off using ScummVM because it's doing memory management differently?  Which would potentially result in less 'Out of Heap' errors?
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Out Of Heap - DosBox vs ScummVM
« Reply #4 on: January 02, 2021, 04:44:29 PM »
So far the out of heap errors are only happening while playing/testing with DosBox, ScummVM doesn't exhibit the same issues. 

I'm sure I've got some more due-diligence to do with heap management - I have added additional scripts into the DisposeCode.sc which has improved things somewhat.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.039 seconds with 24 queries.