processhacker / plugins-extra

These are highly unstable, buggy, incomplete plugins that are not included with Process Hacker by default.
https://processhacker.sourceforge.io/
322 stars 113 forks source link

FIXED - Memory leak in to DPI Awareness Extras plugin #64

Closed VictorVG closed 5 years ago

VictorVG commented 5 years ago

If added DPI Awareness column in to Process tab then memory leak as incremental add Private Bytes size on long time the user not call PH GUI. I see start size ~ 30 MB and after 25 - 28 hours Private bytes size have up to 275 MB or highest. Also PH task not free unused memory the not needed or user send PH command reduce memory use. Possible plug-in not Free(unused_memory) | Free(unused_buffers). ?

skipik commented 5 years ago

Confirmed on Win 10 v1809 x64. Just leave that plugin enabled and wait, you'll see the memory leak.

VictorVG commented 5 years ago

Another Win7SP x64 system. PH v3.0.6503.1976 Git-01398fb4 (included all Plugins Extra) running minimized to try and PH console not used a week ago (startup time is 7:49:33 +0300 14.11.2018) Private Bytes 542,45 MB if DPI Awareness Extras Plugin is exists and enabled, but if disabled and deleted this plug-in I see thats Private bytes 18,73 MB and memory leak not exist.

Test system config is: i3-2120 / z68 / 16 GB DDR3-1600 / NVIDIA GTX 650 / HDD WDC RE3 1 Tb / OS Win7 SP1 x64.

dmex commented 5 years ago

@poizan42

The DaepProcessesUpdatedHandler forgets to PhFree the processes result from PhEnumProcessesEx and also doesn't free the orderedProcesses allocation from calloc.

You able to take a look?

poizan42 commented 5 years ago

@dmex the result from PhEnumProcessesEx is stored in the global ExtendedProcesses and freed on the next update, but it does leak if the calloc for orderedProcesses fails.

The orderedProcesses is leaked, I'll fix that.

VictorVG commented 5 years ago

Fixed.