使用巨大的 XSD 构建 JAXB 上下文会耗尽内存 - 解决方法?
编辑:这个人有同样的问题,并且更好地解释了它,我觉得: http:// /www.java.net/forum/topic/glassfish/metro-and-jaxb/building-jaxb-contexts-huge-xsds-runs-ou
我的同事告诉我,我们有很多 JAXB 类型,以至于当通过 JAXB 上下文加载它们时,我们的部署环境内存不足,并要求我和其他人查看一下。他们可能已经将堆大小增加到了最大值,并且暂时不可能使用新硬件(假设我们现在只能使用 32 位)。他们讨论了拆分 JAXB 项目并使用不同的上下文,但如果他们希望同时将所有内容都存储在内存中,我看不出这有什么帮助。我建议插入对垃圾收集器的显式调用,但这并不顺利。有什么想法吗?
Edit: This guy has the same problem, and does a better job of explaining it I feel:
http://www.java.net/forum/topic/glassfish/metro-and-jaxb/building-jaxb-contexts-huge-xsds-runs-ou
My colleagues have informed me that we have so many JAXB types, that we're running out of memory in our deployment environment when loading them via JAXB context, and have asked me and others to take a look at it. They may have already increased the heap size to the max, and new hardware is out of the question for now(assume we're stuck with 32-bit for now). They've talked about splitting JAXB projects up and using different contexts, although I don't see how that helps if they want everything in memory at the same time. I've suggested inserting explicit calls to the Garbage Collector, but that didn't go over well. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JAXB 上下文使用反射,因此他们需要增加永久代空间。
The JAXB context uses reflection, so they needed to increase their permgen space.