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

proxy instance cause a PermSpace OOM #6742

Closed
2 tasks done
libo3603 opened this issue Sep 15, 2020 · 1 comment · Fixed by me0106/dubbo#5
Closed
2 tasks done

proxy instance cause a PermSpace OOM #6742

libo3603 opened this issue Sep 15, 2020 · 1 comment · Fixed by me0106/dubbo#5

Comments

@libo3603
Copy link

libo3603 commented Sep 15, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.8
  • Operating System version: window 7
  • Java version: 1.8.0_261

Steps to reproduce this issue

  1. User Proxy to create new instance of any interface
  2. System full GC
  3. Check PermSpace unuse size

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

PermSpace used size will no increase
永久区使用空间不会明显增长

What do you expected from the above steps?

Actual Result

PermSpace used size will increase after very Full GC, which cause a OutOfMemoryError [PermSpace]
永久区使用空间在每次full GC之后都会有所增加,直到永久区内存溢出。

If there is an exception, please attach the exception trace:
java.lang.RuntimeException: by java.lang.OutOfMemoryError: PermGen space

Just put your stack trace here!

java.lang.RuntimeException: by java.lang.OutOfMemoryError: PermGen space

@libo3603
Copy link
Author

因为 org.apache.dubbo.common.bytecode.Proxy 中使用的Proxy对象缓存导致。
PROXY_CACHE_MAP 缓存的Proxy实例,使用WeakReference,full GC 后会释放该Proxy实例
再次申请对象实例时,Proxy会重新创建Proxy的Class对象,最终导致PermGen space内存溢出。
应该修改为缓存该Proxy Class,而不是 Proxy 对象实例。

xiaoheng1 added a commit to xiaoheng1/incubator-dubbo that referenced this issue Mar 15, 2021
xiaoheng1 added a commit to xiaoheng1/incubator-dubbo that referenced this issue Mar 16, 2021
xiaoheng1 added a commit to xiaoheng1/incubator-dubbo that referenced this issue Mar 16, 2021
AlbumenJ pushed a commit that referenced this issue Apr 13, 2021
* fix #6742 cache Class avoid PermGen space OOM

* optimization cache Class avoid PermGen space OOM

* optimization cache Class avoid PermGen space OOM

* Optimize Proxy WeakReference to SoftReference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant