Skip to content
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

[zPIV] Free memory from ToString() #904

Merged
merged 1 commit into from Jun 18, 2019

Conversation

Projects
None yet
5 participants
@Warrows
Copy link
Collaborator

commented May 24, 2019

Fix a memory leak.

Before: (https://gist.github.com/Warrows/755c33593a74addcfedbe3cd5a9b8eb4)

==10580== LEAK SUMMARY:
==10580==    definitely lost: 8,080,863 bytes in 133,017 blocks
==10580==    indirectly lost: 0 bytes in 0 blocks
==10580==      possibly lost: 288 bytes in 1 blocks
==10580==    still reachable: 2,224 bytes in 10 blocks
==10580== suppressed: 0 bytes in 0 blocks

After: (https://gist.github.com/Warrows/ab3b40e7b8e56bf0570923f77715f922)

==10478== LEAK SUMMARY:
==10478==    definitely lost: 160 bytes in 1 blocks
==10478==    indirectly lost: 0 bytes in 0 blocks
==10478==      possibly lost: 288 bytes in 1 blocks
==10478==    still reachable: 2,224 bytes in 10 blocks
==10478==         suppressed: 0 bytes in 0 blocks
[zerocoin] Free memory from ToString()
Simple fix for a minor memory leak

@Warrows Warrows added the review label May 24, 2019

@Warrows Warrows self-assigned this May 24, 2019

@presstab

This comment has been minimized.

Copy link

commented May 24, 2019

How long were you running for it to result in this 8mb leak? Or maybe a better question, what was it running and how many did it do? ie, syncing x amount of blocks?

Good find.

@Warrows

This comment has been minimized.

Copy link
Collaborator Author

commented May 24, 2019

I don't remember exactly. I'd say something like a few thousands blocks sync (that was on testnet).

@Warrows Warrows changed the title [zerocoin] Free memory from ToString() [zPIV] Free memory from ToString() May 26, 2019

@Fuzzbawls Fuzzbawls added this to the 3.3.0 milestone May 28, 2019

@Mrs-X

Mrs-X approved these changes Jun 3, 2019

Copy link
Collaborator

left a comment

Nice catch 👍 utACK

Never heard of mp_get_memory_functions(), this is quite sexy :-)

@Fuzzbawls
Copy link
Collaborator

left a comment

ACK 9c0329c

@random-zebra
Copy link
Collaborator

left a comment

ACK 9c0329c

@Fuzzbawls Fuzzbawls merged commit 9c0329c into PIVX-Project:master Jun 18, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Fuzzbawls added a commit that referenced this pull request Jun 18, 2019

Merge #904: [zPIV] Free memory from ToString()
9c0329c [zerocoin] Free memory from ToString() (warrows)

Tree-SHA512: c04bfcf1af3b9fd95cf6aa653367043d4a973805c37e820b3127a3198efbdb0f83eb82d8084409f17e059e44e7c653666899a5733dd1f272d0829ae0ceee388d

@Warrows Warrows deleted the Warrows:2019_valgrind branch Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.