标题:java 陣列問題
取消只看楼主
loyusum
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2017-4-29
结帖率:100%
已结贴  问题点数:20 回复次数:0 
java 陣列問題
有一天我打算寫一個加密的程式。
本來好好的,可以正常使用
但我拿去加密一個1.07GB的檔案時就出事了
執行時顯示:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    at try2$SampleActionListener.actionPerformed(try2.java:131)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

查看後發現[byte inb = new byte[1150961924];]這句出了問題
如何解決 ?
搜索更多相关主题的帖子: 加密 Java java thread 
2017-04-29 11:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-476526-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.578328 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved