SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Memory leak leads to OutOfMemoryException in some cases

Pathoschild opened this issue ยท 3 comments

commented

Some players report OutOfMemoryException errors since the Stardew Valley 1.4.2 release (see timeline below). Once it started happening, previous versions of SMAPI and Stardew Valley were retroactively affected.

Reports

report game SMAPI CP log
2019-12-05 hiabara on Nexus
(asset reload issue)
1.4.2 3.0.1 1.10.1 log A and B
2019-12-12 Alvaror on Nexus
(asset reload issue; on Discord says started c. 8th)
1.4.2 3.0.1 1.10.1 log
2019-12-12 Spartan69 on Nexus
(asset reload issue)
1.4.2 3.0.1 1.10.1 log
2019-12-24 snesknees on Nexus
(return to title issue)
1.4.3 3.0.1 1.11 log
2019-12-28 mihihia on Nexus 1.4.3 3.0.1 1.11.1 log
2019-12-29 buckminst on Nexus 1.4.3 3.0.1 1.11.1 log

Timeline

date event
2019-11-26 Stardew Valley 1.4
SMAPI 3.0
Content Patcher 1.10
2019-12-02 Stardew Valley 1.4.1
SMAPI 3.0.1
Content Patcher 1.10.1
2019-12-04 Stardew Valley 1.4.2
2019-12-05 first report
commented

Tested scenarios:

  • SDV 1.4.3 + SMAPI 3.0.1 + CP 1.11 seasonal pack
    Most reports involve Content Patcher packs which change textures often. For example, here I repeatedly went indoors/outdoors to reload seasonal textures until it crashed:

  • SDV 1.4.3 + SMAPI 3.0.1 (no mods)
    It also happens with SMAPI but no mods, by repeatedly loading a save and returning to title. For example, here I did that until the game became unbearably slow (but didn't crash outright):

  • SDV 1.3.36 + SMAPI 2.11.3 (no mods)
    It also happens with Stardew Valley 1.3.36 (released January 2019) and SMAPI 2.11.3 (released September 2019), even though no issues were reported until December 2019 (and multiple issues were reported since then).

  • SDV 1.4.3 without SMAPI
    It doesn't happen without SMAPI.

This happens even if I strip out SMAPI's content pipeline, so it's not strictly related to asset handling. It doesn't happen if I run SMAPI with all features and APIs stripped out, so it's something in the SMAPI code.

commented

Per my comments in Discord, this seems to be an issue in every build of SDV + SMAPI I've managed to test. I first noticed some memory leakage in October or November of 2019. Task Manager reports ~20MB more memory each time I open the "Load" menu, and ~60MB more each time I load any saved game. The results are similar with or without any mods.

I've tested the following versions and experienced similar leak rates:

  • SDV 1.4.3 + SMAPI 3.0.1
  • SDV 1.3.36 + SMAPI 2.11.3
  • SDV 1.3.36 + SMAPI 2.11-beta
  • SDV 1.3.27 + SMAPI 2.6

As you mentioned, this could be a persistent (but previously benign) memory leak or a result of more recent Windows updates. These specific results happened in Windows 10 Pro, Build 18362 (last updated in July 2019).

commented

Fixed in develop for the upcoming SMAPI 3.1.