Closed MarcellVokk closed 1 year ago
I'd advice you to read this issue: https://github.com/justinstenning/Direct3DHook/issues/80 @justinstenning just fixed a memory leak, and you should also make sure your code is working correctly.
@Vadkarika2 When you say redraw, do you mean sending a complete new overlay to the target?
Can you please provide a quick and simple reproducible snippet for the scenario?
In my heavily modified version of this project, I wrap the code in DXSprite.cs -> BeginBatch(ShaderResourceView texSRV) with a using statement:
using (Texture2D tex = _batchTexSRV.ResourceAs<Texture2D>()) { Texture2DDescription texDesc = tex.Description; _texWidth = texDesc.Width; _texHeight = texDesc.Height; } _spriteList.Clear();
It eliminated one of a few leaks I encountered. My overlay changes each time I send it, and @justinstenning , I think this is what @Vadkarika2 is doing.
Hi! Thanks for the help!
What I mean by redraw is I send a new overlay, yes...
I'll try out what @jazzup suggested, and post an update on the results!
Thanks again, M
Yep! This fixes my issue, thanks for the suggestion!
I made a pull request (#82) where I fixed this memory leak using @jazzup's suggestion!
Merged, thx
Hi!
I've been using this library for a couple of days now, and I came across what I think is a realy small memory leak somewhere... After calling the DrawOverlayInGame method for more than 70,000 times, a memory leak occurs, and becomes more noticable with each redraw...
At 50,000 redraws the memory usage of the target app is 205.4MB, but at 100,000 redraws, it jumps up to 555.1MB, and after that, it goes out of hand, and at 110,000 redraws the memory usage jumps to 1,2GB... The overlay contains 1 image element, which is being changed every frame, and the size of it is 1920x1080...
I'd realy appreciate if someone could look into this, this is a realy cool library!
Thanks, M