Java大文件上载抛出java.io.IOException:映射失败 [英] Java Large File Upload throws java.io.IOException: Map failed

查看:1656
本文介绍了Java大文件上载抛出java.io.IOException:映射失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring和Hibernate并尝试上传大文件但是当我尝试上传
超过150 Mb然后它会产生错误,如

I am using Spring and Hibernate and try to upload large file but when i try to upload more then 150 Mb then it is generating error like

Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:755)
... 157 more

我正在使用Windows 64位操作系统。经过大量的谷歌搜索后,我发现这是JDK中的错误。
任何人都可以帮我解决这个问题吗?

I am using windows 64bit OS. After lots of googling i find that this is bug available in JDK. Can any one help me to solve this issue?

有人写这个问题 https://github.com/MLCL/Byblo/issues/78 。但我不确定这是不是错误。如果bug那么我怎么解决它。这是任何其他适当的解决方案。

Some one write about this issue https://github.com/MLCL/Byblo/issues/78. but i am not sure this is bug or not. if bug then how can i resolve it. It any other appropriate solution for this.

推荐答案

增加你的JVM堆大小?

Increase your JVM heap size?

-Xmx1024m

这篇关于Java大文件上载抛出java.io.IOException:映射失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆