Skip to content

fixing small leak on exception on the transport-epoll-native allocation#3844

Closed
clebertsuconic wants to merge 1 commit into
netty:masterfrom
clebertsuconic:master-exception
Closed

fixing small leak on exception on the transport-epoll-native allocation#3844
clebertsuconic wants to merge 1 commit into
netty:masterfrom
clebertsuconic:master-exception

Conversation

@clebertsuconic

Copy link
Copy Markdown
Contributor

Motivation:

the JNI function ThrowNew won't release any allocated memory.
The method exceptionMessage is allocating a new string concatenating 2 constant strings
What is creating a small leak in case of these exceptions are happening.

Modifications:

Added new methods that will use exceptionMessage and free resources accordingly.
I am also removing the inline definition on these methods as they could be reused by
other added modules (e.g. libaio which should be coming soon)

Result:

No more leaks in case of failrues.

@netkins

netkins commented May 29, 2015

Copy link
Copy Markdown

AUTOMATED MESSAGE for ADMINS:
Please verify and accept the pull request.
To accept, say @netkins accept
To build again, say @netkins build
To whitelist the author, say @netkins whitelist

@normanmaurer

Copy link
Copy Markdown
Member

@netkins accept

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2015

@normanmaurer

Copy link
Copy Markdown
Member

@clebertsuconic
clebertsuconic force-pushed the master-exception branch 4 times, most recently from aaf10b5 to 4905535 Compare May 29, 2015 20:56
@clebertsuconic

Copy link
Copy Markdown
Contributor Author

I already did the cla.. about a month (3 weeks maybe) ago

Motivation:

the JNI function ThrowNew won't release any allocated memory.
The method exceptionMessage is allocating a new string concatenating 2 constant strings
What is creating a small leak in case of these exceptions are happening.

Modifications:

Added new methods that will use exceptionMessage and free resources accordingly.
I am also removing the inline definition on these methods as they could be reused by
other added modules (e.g. libaio which should be coming soon)

Result:

No more leaks in case of failures.
@clebertsuconic

Copy link
Copy Markdown
Contributor Author

@normanmaurer I have made a mess on my git clones to fix these diffs.. I probably created a thousand jobs on the netkins.. but I don't have authorization to cleanup them...

I'm settled now.. if you could please cleanup the queue since I don't have authorization to kill a job.

@Scottmitch

Copy link
Copy Markdown
Member

@clebertsuconic - Awesome! Thanks for the fix!

@normanmaurer

Copy link
Copy Markdown
Member

@clebertsuconic thanks again!

Cherry-picked into 4.0 (ea0f84e), 4.1 (70e3d17) and master (c0e889a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants