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

Breakout example has memory leaks #232

Closed
fuchsnj opened this issue Aug 19, 2020 · 7 comments
Closed

Breakout example has memory leaks #232

fuchsnj opened this issue Aug 19, 2020 · 7 comments
Labels
C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples C-Performance A change motivated by improving speed, memory usage or compile times

Comments

@fuchsnj
Copy link
Contributor

fuchsnj commented Aug 19, 2020

I was testing out the breakout example, and noticed the movement wasn't very smooth. I checked the CPU, and noticed it was using ~70% across all 8 cores! (i7-4710HQ CPU @ 2.50GHz)

I also noticed the memory usage started around 20 MB (which already seemed high) and it slowly increased to over 57 MB about 15 minutes later (when I killed it)

Probably not as important, but I did want to note the ball in breakout somehow managed to leave the boundaries and never came back.

Overall, it was a pretty poor first impression for the game engine.

This was running in release mode on Ubuntu 20.04.1 LTS
The only thing odd I noticed was this warning in the terminal: INTEL-MESA: warning: Haswell Vulkan support is incomplete

If there is anything I can give that might help with some of these issues, just ask.

@DGriffin91
Copy link
Contributor

Just tested the breakout example with --release on Windows 10 with Core i7-6700K, Nvidia GTX 1060:

  • Start: CPU 8%, Memory 59MB
  • After all blocks gone: CPU 7%, Memory 59MB
  • After around 15min: CPU 7%, Memory 60MB

@multun
Copy link
Contributor

multun commented Aug 19, 2020

The high CPU usage is a recently fixed bug of rayon, one of the dependencies of the project. It hasn't yet reached a release, but should soon.

Probably not as important, but I did want to note the ball in breakout somehow managed to leave the boundaries and never came back.

Yeah that was pretty bad, I think that's fixed on master.

Overall, it was a pretty poor first impression for the game engine.

The project is very, very young, and unfortunately still contains many bugs, and new bugs will be added and fixed as the project grows. The current state of the project isn't what made me want to contribute: bugs can be fixed easily, the code looks pretty good, and the architecture is better than everything else I could find.

I'll investigate that memory leak as soon as I have time

@cart
Copy link
Member

cart commented Aug 19, 2020

Thanks for the feedback!

I can comfortably say that if you're looking for a production-ready engine, we aren't even remotely close. We will lose on most benchmarks, probably by a wide margin. Fortunately we are also generally aware of most issues and have plans to resolve them. I'm also relatively confident that we're laying good foundations here. It will just take time.

Theres already a similar issue on general performance and cpu usage / rayon. I left more details there: #111

Lets leave this open, but scope this issue to the memory leaks.

@cart cart changed the title Breakout example has poor performance / high cpu / memory leak / bugs Breakout example has memory leaks Aug 19, 2020
@cart
Copy link
Member

cart commented Aug 19, 2020

Also master should have a fix for the ball leaving the bounds.

@cart cart added the C-Bug An unexpected or incorrect behavior label Aug 19, 2020
@Fishrock123
Copy link
Contributor

Fishrock123 commented Aug 21, 2020

For me, the game in release starts around 62mb and then drops down to 55mb shortly after all the blocks are destroyed.

Over 20-ish minutes it slowly grew to 67-ish mb.

I'm running this (Windows):

stable-x86_64-pc-windows-msvc (default)
rustc 1.45.0 (5c1f21c3b 2020-07-13)

Edit: that was on git commit 505c79b (Yesterday's master)

@CastilloDel
Copy link

CastilloDel commented Sep 23, 2020

Also master should have a fix for the ball leaving the bounds.

The ball still leaves the bounds in my machine as of commit 028a22b
In Debian with Wayland

--Edit

After doing some more testing it seems it has to do with the fps. If the fps are low the bound checks can say the collision happened in the other side of the wall, causing the ball to not be reflected.

I guess it could be fixed by making the walls thicker (?). I don't know if this really needs to be addressed or if this is the correct issue to post about it

@alice-i-cecile alice-i-cecile added C-Performance A change motivated by improving speed, memory usage or compile times C-Examples An addition or correction to our examples labels Feb 17, 2021
@alice-i-cecile
Copy link
Member

High CPU usage has been solved by us removing Rayon.
Ball escapes was solved by #1541.
Memory leak: unsure if this still applies; there's been a number of relevant changes that could have fixed this.

Closing for now; please open a new issue if you still experience a memory leak <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples C-Performance A change motivated by improving speed, memory usage or compile times
Projects
None yet
Development

No branches or pull requests

7 participants