Open DBruceLee opened 4 years ago
这个我也发现了
作者快点更新啊
所有的.toBase64()都会有内存上涨问题
写了一个while死循环一直toBase64(),然后内存都要炸了。
初步看了一下,这块可能有内存泄漏问题。
https://blog.csdn.net/loophome/article/details/101773866
作者可以参考这个博客,解决BufferedImage内粗溢出问题,作者赶快改啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8209113
不用等作者修复了,你可以升级你的jdk版本解决这个问题。
目前用的是8,需要升级到哪个版本呢,线上应用不可能因为这一个功能升级版本呢
发自我的iPhone
------------------ 原始邮件 ------------------ 发件人: 李泽波 <notifications@github.com> 发送时间: 2020年9月8日 11:39 收件人: whvcse/EasyCaptcha <EasyCaptcha@noreply.github.com> 抄送: DBruceLee <1204504782@qq.com>, Author <author@noreply.github.com> 主题: 回复:[whvcse/EasyCaptcha] 调用 SpecCaptcha.toBase64() 方法时,会导致系统内存持续上涨 (#28)
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8209113
不用等作者修复了,你可以升级你的jdk版本解决这个问题。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
目前用的是8,需要升级到哪个版本呢,线上应用不可能因为这一个功能升级版本呢 发自我的iPhone … ------------------ 原始邮件 ------------------ 发件人: 李泽波 <notifications@github.com> 发送时间: 2020年9月8日 11:39 收件人: whvcse/EasyCaptcha <EasyCaptcha@noreply.github.com> 抄送: DBruceLee <1204504782@qq.com>, Author <author@noreply.github.com> 主题: 回复:[whvcse/EasyCaptcha] 调用 SpecCaptcha.toBase64() 方法时,会导致系统内存持续上涨 (#28) https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8209113 不用等作者修复了,你可以升级你的jdk版本解决这个问题。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我用的jdk11都无法解决这个问题,最终只能缓存Font对象,不能每次都去床架Font
JDK 11 | JDK 13 | JDK 14 | JDK 8 | Other |
---|---|---|---|---|
11.0.8Fixed | 13.0.4Fixed | 14 b27Fixed | 8u281Fixed | openjdk8u272Fixed |
方案
您好,我最近也发现了这个问题,生成验证码引发内存大量上涨,此内存并不受jvm管控。 这是什么原因引起的呢?是堆外内存泄露么? 您目前找到解决方案了么?
JDK 11 JDK 13 JDK 14 JDK 8 Other 11.0.8Fixed 13.0.4Fixed 14 b27Fixed 8u281Fixed openjdk8u272Fixed
找不到jdk8u281这个版本呀!只看到最终版本8u271
我遇到这个问题时候,已经解决了,内存持续上涨是因为java的font字体管理存在内存泄露导致的。我原来用的是Java8u261和Java8u271,这个版本会存在内存泄露,然后更换了IBM的Java8u275得以解决这个问题,内存不在上涨。下载链接:https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=openj9
https://github.com/zfoo-project/zfoo/tree/main/util/src/main/java/com/zfoo/util/captcha
高版本java中我缓存了Font对象才解决了这个问题,并且高版本java我用了spring自带的计算器
我用的jdk11,oracle和open jdk都有测试过