seredat / karbowanec

Karbo (Karbovanets) - Digital Exchange Medium - cryptocurrency made in Ukraine, CryptoNote protocol implementation.
https://karbo.io/
Other
104 stars 66 forks source link

Memory leak fix #41

Closed momchilmg closed 6 years ago

momchilmg commented 6 years ago

file : src/crypto/slow-hash.c

line 479 : VirtualFree(hp_state, MEMORY, MEM_RELEASE);

The correct expression is : VirtualFree(hp_state, 0, MEM_RELEASE);

I have 24GB RAM and this wallet get 95% without this fix.

More info here : https://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx

"If you specify this value, dwSize must be 0 (zero), and lpAddress must point to the base address returned by the VirtualAlloc function when the region is reserved. The function fails if either of these conditions is not met."

Thanks! :)

aivve commented 6 years ago

Thanks! Would you like to make pull request?

momchilmg commented 6 years ago

Sorry, but I'm busy right now. You can add this change ;) Thanks for your proposition!

Your project is great. We will use your code in our project. We respect GPL licence and your work has been respected. :) This is beta version for now - http://blablahost.net/Levcoincash-1.0.3.exe

aivve commented 6 years ago

It's not urgent. We will review and commit it for next update. Thanks again.

aivve commented 6 years ago

Confirmed.

Incorrect Size parameter for VirtualFree (MEM_RELEASE) operation.
200000 - Incorrect size used by the application.
0 - Expected correct size (0).
momchilmg commented 6 years ago

Two beta testers confirm the fix and hashrate is increase too.

aivve commented 6 years ago

Need to check memory usage more.

momchilmg commented 6 years ago

Yes, but this is very hard work ;) For now I think this is enough.