View Issue Details

IDProjectCategoryView StatusLast Update
0009833New issuesMulti Theft Auto : San Andreaspublic2018-03-28 12:08
ReporterPirulaxAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Summary0009833: Memoryleak in dxDraw* functions.
Description

It seems like theres some kind of a memleak in dxDraw* functions.

Steps To Reproduce

Just run this code:
https://pastebin.com/5gSBnzNz

Additional Information

I was running some benchmarks with dxDrawImage functions, when i noticed, that my mem usage for GTA:SA suddenly went up to 1.3GB.I tried to reproduce the same ammount, but failed to do that, but still managed to get ~100mb, theres another code which with i got that 1.3GB, right here:
https://pastebin.com/bRSRkyd8

TagsNo tags attached.

Activities

Pirulax

2018-03-28 00:17

viewer   ~~0026484

Try running a big number with my second code, like 700k or 1M, it will get up to 1gb.

Pirulax

2018-03-28 00:19

viewer   ~~0026485

Got a crash too.

Version = 1.5.5-release-11915.0.000
Time = Wed Mar 28 00:17:40 2018
Module = E:\MTA 1.5\mta\core.dll
Code = 0xE06D7363
Offset = 0x001D23AC

EAX=0177EDC0 EBX=20C621DC ECX=00000003 EDX=00000000 ESI=5F9D23C8
EDI=0177EE30 EBP=0177EE18 ESP=0177EDC0 EIP=73F9AA12 FLG=00000216
CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B

Tried to run 11M :D

ccw

2018-03-28 00:47

administrator   ~~0026487

About your benchmarking code: Timing dxDrawImage will only measure the time it takes to add the draw command to the graphics queue. To benchmark dx* functions, measure the number of ticks between onClientRender events.

The reason for the memory use (and crash) is 5M calls to dxDrawImage creates a huge draw queue.

Pirulax

2018-03-28 01:06

viewer   ~~0026488

Even do, the draw queue is really big, it should free up the memory, should't it?

ccw

2018-03-28 01:11

administrator   ~~0026489

Yes, it should

Pirulax

2018-03-28 01:12

viewer   ~~0026490

Sorry, for kinda 'flooding' comments, but i always forgot to say something.
How should i test exactly dx functions then?Calling them with a for loop in an onCR, and wait for it to draw 1K frames, and then just divide the time elpased between by the number of frames?

Issue History

Date Modified Username Field Change