-
Notifications
You must be signed in to change notification settings - Fork 444
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
drawDebug massive memory leak #3285
Comments
Update: it's happening on Android too. It's making it almost impossible to debug hitBoxes in my game on different devices. |
Might be related: #3168 |
Has anyone done any profiling, yet? |
Possibly related: openfl/openfl#1883 |
I tried the issue I linked, no memory leaks found. I tried the following on html5, I waited a while and memory stayed within the same bounds for about a half hour. package states;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.group.FlxGroup;
import flixel.math.FlxRect;
import flixel.util.FlxColor;
class DebugSelectionTestState extends flixel.FlxState
{
static inline var SIZE = 16;
final sprites = new FlxTypedGroup<FlxSprite>();
override function create():Void
{
super.create();
add(sprites);
createMess(2.0, true);
// scroll to center of mess
FlxG.camera.scroll.x = FlxG.width / 2;
FlxG.camera.scroll.y = FlxG.height / 2;
#if FLX_DEBUG
FlxG.debugger.drawDebug = true;
FlxG.debugger.visible = true;
#end
}
function createMess(density = 0.5, sortColors = true)
{
final area = FlxRect.get(0, 0, FlxG.width * 2, FlxG.height * 2);
var count = Std.int(area.width * area.height / (SIZE * SIZE) * density);
while (count-- > 0)
{
final sprite = sprites.recycle(()->new FlxSprite());
sprite.makeGraphic(SIZE, SIZE);
sprite.x = FlxG.random.float(area.left, area.right - SIZE);
sprite.y = FlxG.random.float(area.top, area.bottom - SIZE);
final hue = 60 * FlxG.random.int(0, 6);
sprite.color = FlxColor.fromHSB(hue, 1, 1);
}
}
} Can you try the above code and let me know if that causes the memory issue on your machine? If not, we need to learn more about your project, what kind of debug drawing are you doing? if you disable debug drawing on specific things (via |
I can't do much about this until we learn more about this and how to reproduce it locally. I'm taking it off the 5.9.0 release. If anyone has more info please let us know |
Code snippet reproducing the issue:
FlxG.debugger.visible = true; FlxG.debugger.drawDebug = true;
(You have to use
lime test html5 -debug
to reproduce.Observed behavior:
I've been porting my game from Phaser to flixel and ran into a memory leak in the html5 target. (thought it was lime but we narrowed it down to flixel in this issue. If you need private access to my repo to reproduce let me know. The leak was confirmed by another user in previous issue and they directed me here for further invesigating.
The text was updated successfully, but these errors were encountered: