Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory for Rock Raiders is not fully cleaned up between levels #56

Open
trigger-segfault opened this issue Sep 20, 2022 · 0 comments
Open
Labels
investigate Not sure what the problem is yet. memory A memory leak or access violation.

Comments

@trigger-segfault
Copy link
Owner

trigger-segfault commented Sep 20, 2022

Describe the issue
When teleporting down hundreds of rock raiders, the memory usage in the VS Debugger will slowly skyrocket (~2MB per rock raider!!!). When exiting a level, this memory is not cleaned up at all. This is not related to standard listSet expansion, because the memory increase happens with every unit.

This occurs with both Mini-Figure and RockMonster object types, so it may be an issue with the CreatureModel or the MeshLOD (in which case Vehicle types may also be affected).

The current theory is that this is related to MeshLOD, because the memory usage only goes up when teleporting down the Nth unit for the first time, meaning restarting the level and teleporting down new units won't increase usage until exceeding the previous max. MeshLOD has some funky behaviour with allocating contiguous memory for cloned meshes. So this may likely be the key to what's happening.

Update: It's not the MeshLOD, it seems to be the CreatureModel Container. Disabling MeshLOD cloning doesn't stop the memory consumption, so the issue has to be burried somewhere in one of the aspects of Containers.

Expected behaviour
Memory should be reasonably cleaned up between levels, it's understandable for some memory to stay, like those of list sets. But there are no other known structures that should continuously consume decent amounts of memory without returning it.

Steps to reproduce

  1. Run OpenLRR in the VS Debugger.
  2. Start any level.
  3. Turn on the Disable Oxygen Consumption cheat to allow endless unit spawning.
  4. Continue to teleport down rock raiders and watch as memory usage jumps up with each unit.

Additional information

  • Time played this session: 4-10 minutes
  • Level: Driller Night!
  • Game speed: 100%-300%
  • Graphics fix: dgVoodoo 2.79.3
  • Using mods: None
@trigger-segfault trigger-segfault added bug Something went wrong. memory A memory leak or access violation. labels Sep 20, 2022
@trigger-segfault trigger-segfault changed the title Memory for Rock Raiders is not fully cleaned up between levels. Memory for Rock Raiders is not fully cleaned up between levels Sep 20, 2022
@trigger-segfault trigger-segfault added investigate Not sure what the problem is yet. and removed bug Something went wrong. labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Not sure what the problem is yet. memory A memory leak or access violation.
Projects
None yet
Development

No branches or pull requests

1 participant