永发信息网

java.创建一个byte数组,long length = file.length(); byte[] bytes =

答案:1  悬赏:20  手机版
解决时间 2021-03-10 09:22
java.创建一个byte数组,long length = file.length(); byte[] bytes = new byte[(int)length]; 结果导致
问题错误为:java.lang.OutOfMemoryError:Java heap space
\x05at com.hitrust.FCBCNB.service.impl.MONServiceImpl.getBytesFromFile(MONServiceImpl.java:76)
\x05at com.hitrust.FCBCNB.service.impl.MONServiceImpl.spliteBytes(MONServiceImpl.java:97)
\x05at com.hitrust.FCBCNB.service.impl.MONServiceImpl.getFileLine(MONServiceImpl.java:59)
\x05at com.hitrust.FCBCNB.service.impl.MONServiceImpl.upload(MONServiceImpl.java:45)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
\x05at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
\x05at java.lang.reflect.Method.invoke(Method.java:597)
\x05at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
\x05at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
\x05at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
\x05at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
\x05at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
\x05at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
\x05at $Proxy6.upload(Unknown Source)
\x05at com.hitrust.FCBCNB.test.MonTest.testA(MonTest.java:30)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
\x05at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
\x05at java.lang.reflect.Method.invoke(Method.java:597)
\x05at junit.framework.TestCase.runTest(TestCase.java:154)
\x05at junit.framework.TestCase.runBare(TestCase.java:127)
\x05at junit.framework.TestResult$1.protect(TestResult.java:106)
\x05at junit.framework.TestResult.runProtected(TestResult.java:124)
\x05at junit.framework.TestResult.run(TestResult.java:109)
\x05at junit.framework.TestCase.run(TestCase.java:118)
\x05at junit.framework.TestSuite.runTest(TestSuite.java:208)
\x05at junit.framework.TestSuite.run(TestSuite.java:203)
\x05at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
\x05at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
\x05at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
\x05at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
请问该如何解决,这里的length大小为150994943.
最佳答案

好恐怖的长度


我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
我有一瓶兰芝睡眠面膜,是别人从韩国直接带来
单选题在下列各组元素中,构成原生质的主要元
明年环保还会继续吗
铝合金玻璃移门槽 山字槽 U形槽如何安装
大苴箐地址在哪,我要去那里办事
飞机适宜在离地面20千米以上的空中飞行,这是
如果办了信用卡,暂时不用,收不收费?
中国电信的师傅说,网线过长对网速有影响,是
翻译:The American Beailty is a cultivated
舌头尖发麻什么原因
520烘焙坊软件园店地址在什么地方,想过去办
我国山西省的什么古城,云南省的什么古城,安徽
报销单能推迟多久报销
怎么列古算趣题:“执竿进屋”的方程
《爱情雨》里郑夏娜手机铃声是什么
推荐资讯
南北葶苈子区别
朝阳社区居务监督委员会在什么地方啊,我要过
肝脏英语怎么说
公元前452~签450年,罗马共和国先后铸造十二
1000克黄豆98.9元,十吨要多少钱?
我是西昌学院的,今天在学校查成绩,以前查明
—.—That’s not all necessary. I’m al fo
寺院门匾用哪种字体
休闲西服,衬衫,牛仔裤搭配,衬衫的下摆如何处
孕妇炒菜可以放鸡粉,鸡精吃吗
菏泽市开发区佃户屯办事处刘常社区居民委员会
雄业电器地址在什么地方,想过去办事
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?