黑莓内存不足错误

发布于 2024-12-08 02:51:38 字数 115 浏览 4 评论 0原文

我收到 OutOfMemoryError。我该如何解决这个问题?

错误:java.lang.OutOfMemoryError:Java 堆空间

I am getting an OutOfMemoryError. How do I solve this?

Error: java.lang.OutOfMemoryError: Java heap space

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦罢 2024-12-15 02:51:38

您需要增加可用堆空间(使用 Java -Xmx 标志)或在应用程序中使用更少的内存。

我建议您尝试使用更少的内存。有很多很好的分析工具,您可以使用它们来发现代码在哪里使用了大量内存。还值得检查的是您没有滥用任何 HashMapObjectOutputStream。如果使用不当,这两个类会因占用内存而臭名昭著。

You need to either increase the available heap space (with the Java -Xmx flag) or use less memory in your application.

I'd recommend that you try to use less memory. There are plenty of good profiling tools out there that you can use to discover where your code uses a lot of memory. It's also worth checking that you are not misusing any HashMaps or ObjectOutputStreams. Those two classes are notorious for soaking up memory if not used properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文