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

[Bug] Memory Leak For Each Sim Iterations #856

Open
TheGroxEmpire opened this issue May 8, 2022 · 9 comments
Open

[Bug] Memory Leak For Each Sim Iterations #856

TheGroxEmpire opened this issue May 8, 2022 · 9 comments
Labels
wontfix This will not be worked on

Comments

@TheGroxEmpire
Copy link
Contributor

TheGroxEmpire commented May 8, 2022

Describe the bug
Pressing the sim button either through the DPS or SIM 1 ITERATION consecutively would spike memory usage infinitely. Waiting for a min after the sim finish would reduce the spike. However the base memory usage of the sim would increase more and more as you press the sim button.

This could be reproduced in any fight time but the problem gets more pronounced as you increase the fight time. Simming one iteration of 5000s duration of sim for 5 times would result in memory usage of up to 3GB before normalizing to 1.7GB compared to 300MB initial memory usage (observed through task manager).

To Reproduce
Steps to reproduce the behavior:

  1. Open task manager or similar tool to observe memory usage and observe the initial memory usage
  2. Load the linked sim
  3. Click on DPS (1 iteration) or SIM 1 ITERATION button 5 times
  4. Observe memory usage during simming
  5. Observe memory usage few minutes after simming

Expected behavior
Previous iterations of sim's memory should not be carried to next iterations of sim i.e., the memory usage should stay the same on each sim iterations.

Sim Links and Screenshots

Sim Link

https://wowsims.github.io/tbc/warrior/#eJzjYtJgEhLiYJzByKTBWMHUwMi8g5H1ACOT1B3WJka2gJzEytQiDiYBTqmbjFwCAncfMUp0PGFUYpv5l/HDbkYuFoGjT0Hi94HiNx4CxYGCzXsYuXgFDu9llLjSyaTE/AuoTFjgNlDB4d2MSpxABRAE1PX7AaPE75tAXUAtv8AiMx4ySpwG6gKJgNTwCLx+AJT/BTFVWOAoUMf9Z2jGHLjPKPH9DkQZxFFXH4DITx9A5PGnIHLeQ0YuDoFp9xgl5m8AsXY+gLCA8m8Ylfg2MLE0MDF2MDGeYGKpYNa6wMQwCqgKqjg4GB0YJZgsGItiuAIEgClNEyLh52AIYag4WILpA0EOjhAREQdPiEiSw0xGiFClw0IIy2G+QwBjBmMCYwTjBEZGIQYpNgFGCUYFxi5GJWNTAwNTA0NDYwMjA0NdIBPINzAFUYZGYAnTWYwMStOYOcEGdWx2UIRZJzlrJgictBf6waTgKcE03NMByz4HelspJC/A2MDIGMAUAYy7CqbMNDB4Z18Ilj0wyQEAvqWERA==

Screenshot

Memory usage at the beginning:
image

Memory usage spike after 5 times single iteration simming using the link above:
image

Memory usage after waiting a minute after the consecutive simming:
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Google Chrome
  • Version 100.0.4896.127
@jimmyt857
Copy link
Contributor

@lologarithm this feels like we're somehow spinning up new worker threads every time?

@lologarithm
Copy link
Contributor

Running this against a dedicated server has the same issue. Normal "dps" and "ep" buttons don't leak at all. Clicking on the 'sim 1 iteration' for logs massively increases the memory of the client. Web server (where the sim is running) memory doesn't seem to be going up.

I am going to guess we are holding all the logs each time you click sim 1 iteration

@lologarithm
Copy link
Contributor

Could also be one of the timeline graphs being held in memory.

Also, doesn't reproduce in firefox... might be something weird chrome is doing?

@jimmyt857
Copy link
Contributor

Ah ok I can look more later this week then

@TheGroxEmpire
Copy link
Contributor Author

It happens with Edge using DPS button and setting the iterations to 1. Albeit at much lower memory leak:

After 10 consecutive sims 5000s duration

image

One minute after consecutive sims

image

I also noticed that once I opened the Detailed Results page the memory usage spiked again:

After opening it

image

One minute after opening it

image

@lologarithm
Copy link
Contributor

Many debugging features get enabled when #iterations == 1 (but not all of them). This would make sense that it still leaks but less. I think this probably has something to do with our debugging / detailed features (obv it isn't a leak in the core sim because the server doesnt leak any memory when the client is)

@jimmyt857
Copy link
Contributor

Played around with this some more; the issue only occurs with the specific settings in that link, because it has duration set to 5000s (83 minutes and 20 seconds). The logs and timeline generation for such a long fight is probably taking a massive about of memory.

@jimmyt857
Copy link
Contributor

To be clear, what I mean is that with a more typical fight length like 500s instead of 5000s I was not seeing the memory leak.

@jimmyt857
Copy link
Contributor

Migrating to wrath in the next week so this won't be fixed.

@jimmyt857 jimmyt857 added the wontfix This will not be worked on label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants