Skip to content

Conversation

@ihsandemir
Copy link
Collaborator

@ihsandemir ihsandemir commented Oct 4, 2018

Fix for leaking memory on thread close. The void pointer argument passed to the thread should be freed before thread exits. The leak was detected using valgrind.

fixes #455

I tried using AbstractThread pointer instead of ThreadInfo struct when creating the thread but then it causes the following lifecycle problem: When the client is shutdown using the ShutdownTask, then when ShutdownTask::run finishes it is possible that HazelcastClientInstanceImpl is destructed and hence the Shutdown thread(AbstractThread type) should not touch any field of HazelcastInstanceImpl. But if we passed the thread pointer, then it will be destroyed and an illegal access will occur.

…sed to the thread should be freed before thread exits. The leak was detected using valgrind.

fixes hazelcast#455
@ihsandemir ihsandemir added this to the 3.10.2 milestone Oct 4, 2018
@ihsandemir ihsandemir self-assigned this Oct 4, 2018
@ihsandemir ihsandemir requested a review from sancar October 4, 2018 08:28
@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

1 similar comment
@devOpsHazelcast
Copy link
Contributor

Linux test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test FAILed.

@devOpsHazelcast
Copy link
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Contributor

Linux test PASSed.

@ihsandemir ihsandemir merged commit d095ef3 into hazelcast:master Oct 4, 2018
@ihsandemir ihsandemir deleted the threadLeakFix branch October 4, 2018 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.10.1 client memory leak - thread allocation

3 participants