且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

tomcat中的Java堆空间错误

更新时间:2023-09-27 12:02:16

您可能正在尝试将整个文件放入内存中.您的第一个尝试应该是更改 Tomcat JVM 启动选项中的 -Xmx 参数,以提供更多记忆.除此之外,您必须一次读取一个文件块,并将其写入硬盘驱动器,以释放内存.

You are probably trying to put the whole file in memory. Your first shot should be to change the -Xmx parameter at the Tomcat JVM startup options to give it more memor. Aside from that, you'll have to read the file one chunk at a time, and write it on the hard drive, so as to free the memory.