Skip to content

Conversation

@Lothrik
Copy link
Contributor

@Lothrik Lothrik commented Jul 7, 2022

self.items in ItemsTab.lua was being copied recursively whenever an UndoState was created, storing way too much information and eventually crashing PoB entirely due to Out of Memory errors.

Limiting that recursion to a certain depth fixes the problem, and doesn't seem to break anything (fingers crossed).

Fixes #3733, #4311.

Demo video: https://www.youtube.com/watch?v=F5ejSSiNgwA

@Lothrik Lothrik added the crash Causes PoB to crash and is High Priority label Jul 7, 2022
Copy link
Member

@Wires77 Wires77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach blows away internal tables to each item, notably modLists. Luckily in every case I can think of, we end up reparsing items anyway, so that's why it ends up working out. I could be wrong about how that works for items, and I can't find any bugs around this solution anyway, so I'm willing to give it a shot.

@Wires77 Wires77 merged commit 77a6142 into PathOfBuildingCommunity:dev Jul 11, 2022
@Lothrik Lothrik deleted the fix-memory-leak branch July 11, 2022 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crash Causes PoB to crash and is High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory issue (crash)

2 participants