Opened 3 weeks ago
Closed 2 weeks ago
#15495 closed defect (fixed)
SCUMM: Reduce maximum heap on platforms with limited memory.
Reported by: | ccawley2011 | Owned by: | sev- |
---|---|---|---|
Priority: | high | Component: | Engine: SCUMM |
Version: | Keywords: | ||
Cc: | Game: |
Description
The maximum heap size for games with new costumes was increased from 2.5 MB to 6 MB in commit ff83c4146a35ee965fb9bc9d8b6af053c8699862, which is likely to be a source of issues on platforms with limited memory. An example is the DS port, which currently crashes frequently in Full Throttle.
Change History (3)
comment:1 by , 3 weeks ago
comment:2 by , 3 weeks ago
FWIW, I have tested the modification I mentioned, and it does help with avoiding crashes on the DS - without it, the game will consistently crash around the time you first meet Maureen, just before the dialogue tree starts. With it, it's possible to progress further in the game past that point.
I suspect a big part of the issue is that other things in both the engine and ScummVM core code are likely to allocate memory outside of the resource manager's heap, whereas the original (which apparently had 8 MB as a minimum total requirement according to MobyGames) would have been more likely to use the larger heap exclusively. I haven't looked into the original in any detail, though.
comment:3 by , 2 weeks ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Moved to Planka: https://planka.scummvm.org/cards/1382184073664923380
Thank you. As it stands this doesn't really look like a bug, from disasm I can see that Full Throttle *really* needs as much as 8 MB of heap.
The way it's done is that it attempts to allocate 8 MB (minus 5 kb) via a sequence of malloc and dealloc operations, to check that the program can actually allocate that much. If it succeeds it keeps and uses that much memory. I'm amazed that it actually managed to work with 2.5 MB, if anything.