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

RmiServiceExporter class-loader and allocation issue [SPR-11562] #16186

Closed
spring-issuemaster opened this issue Mar 16, 2014 · 2 comments
Closed

RmiServiceExporter class-loader and allocation issue [SPR-11562] #16186

spring-issuemaster opened this issue Mar 16, 2014 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Mar 16, 2014

Tahseen Mohammad opened SPR-11562 and commented

Calling services exposed through spring RmiServiceExporter seem to be causing some weired class-loader issue. It seems RMIClassLoader ends up repeatedly trying to load the class, accessing the jar files also causing major allocation pressure.

I found out about this as I ran 'Java Flight Recorder' on a production server that is heavy on RMI. Using JFR's allocation profiling I found the issue. As I tried to narrow it down I found surprisingly that running a native java RMI code performing the same operation do not cause such allocation or classloader access the jar.

The attached archives contains a project that exposes identical services through both version. Two client is also provided to access each type of exported service. There is also an attachment containing the JFR recording from a run involving 1M call to each version of the service. You can open the recording with 'Java Mission Control' that comes with Jdk7.

Native RMI - < 400ms, ~50M allocation
RmiServiceExporter - 235070.18, ~20G allocation

While the performance comparison cannot be made directly since the RmiServiceExporter uses reflection, the allocation is frightening since most of it is around classloading and not directly in reflection/spring code. My assumption is that Spring's use of proxy & reflection is somehow confusing the RMIClassloader.


Affects: 3.2.8, 4.0.2

Attachments:

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 1, 2014

Tahseen Mohammad commented

Has there been any progress on this issue. I would at least love to know if this is a Spring issue or JVM or some third party library, so that I can pursue other avenue if appropriate. I am also willing to help in diagnosing or narrow down the problem if someone can guide me. My knowledge of proxy and classloader is fairly limited though.

More than a fix, I need to know whether its feasible to wait for a fix or simply move the code from Spring RMI to plain java RMI.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.