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

HTML5 memory leak #1862

Closed
mikaleerhart opened this issue Nov 15, 2024 · 12 comments
Closed

HTML5 memory leak #1862

mikaleerhart opened this issue Nov 15, 2024 · 12 comments

Comments

@mikaleerhart
Copy link

mikaleerhart commented Nov 15, 2024

Screenshot 2024-11-14 at 5 07 22 PM

I don't really know where to start to look into this. There's no terminal or console warnings. I was using Phaser and am now porting my game over to HaxeFlixel. I ran into a bad memory leak today in my project (a simple object catching game with pngs, spritesheets, fonts, and sounds). It ran all the way up to 150GB in a matter of seconds.

What I've tried: update haxelib, using git versions of lime/openfl/hcxpp, and using different browsers. I'm stumped so I thought I would make this public. Will happily provide private access to my repo if anyone has time to take a look.

Only is happening in the html5 target (tried debug & final options). Memory usage is fine in neko target although my sound wasn't playing which is why I tried html5 in the first place.

@barisyild
Copy link
Contributor

Do you have a code that can reproduce the problem?

@mikaleerhart
Copy link
Author

Gave you access to my private repo. The memory runs up as soon as you load it in the html5 target.

@barisyild
Copy link
Contributor

Gave you access to my private repo. The memory runs up as soon as you load it in the html5 target.

I built the game and it works fine.

@barisyild
Copy link
Contributor

I contacted you on discord.

@mikaleerhart
Copy link
Author

Weird, you're right, I just built it on my old Linux laptop and no memory leak there. It must be my OS/hardware (macOS 15.1, M2 Mac mini).
I just tried creating a fresh user account on the Mac, made a new directory for haxelib and installed haxe/lime/openfl/flixel. Ran lime test html5 and the leak is back. I'm keeping this open in case anyone has any ideas or can look into it further.

@barisyild
Copy link
Contributor

Weird, you're right, I just built it on my old Linux laptop and no memory leak there. It must be my OS/hardware (macOS 15.1, M2 Mac mini). I just tried creating a fresh user account on the Mac, made a new directory for haxelib and installed haxe/lime/openfl/flixel. Ran lime test html5 and the leak is back. I'm keeping this open in case anyone has any ideas or can look into it further.

try to update flixel with haxelib install flixel

@mikaleerhart
Copy link
Author

mikaleerhart commented Nov 15, 2024

Ok, It's a combo of my project/hardware/OS. I'm gonna comment out every line of code tomorrow until I find the line that is causing the issue and post here to close the issue.

@barisyild
Copy link
Contributor

Ok, It's my project. Not happening in any examples. I'm gonna comment out every line of code tomorrow until I find the line that was causing the issue, and post it here & close the issue.

Ok I found the problem, the problem is debug draw can you please start the program without debug and retry?

@mikaleerhart
Copy link
Author

That's it!
FlxG.debugger.drawDebug = true;
Thank you. Should we close the issue now?

@barisyild
Copy link
Contributor

That's it! FlxG.debugger.drawDebug = true; Thank you. Should we close the issue now?

I think don't close issue because it is a problem that debug draw causes this.

@barisyild
Copy link
Contributor

Please create the issue here: https://github.com/HaxeFlixel/flixel/issues

@mikaleerhart
Copy link
Author

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants