java crash_Java Crash while downloading File

I want do download a big .jar file from my own Server. (https://luis.team) There for I made a thread to download it, because it is very huge. Here is my code for download:

public Update(String version, File outputFile) {

URL url;

URLConnection connection = null;

try {

url = new URL("https://raw.githubusercontent.com/Luuuuuis/InstantVerify/master/version");

connection = url.openConnection();

} catch (IOException e1) {

e1.printStackTrace();

}

assert connection != null;

try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {

String[] versionCode = in.readLine().split("&&");

if (!(versionCode[0].equalsIgnoreCase(version))) {

/*

* Download from URL given in version file

*/

if(versionCode[1] != null && !versionCode[1].equalsIgnoreCase("null")) {

Thread th = new Thread(() -> {

try {

URL downloadURL = new URL(versionCode[1]);

URLConnection urlConnection = downloadURL.openConnection();

urlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36");

InputStream inputStream = urlConnection.getInputStream();

OutputStream outputStream = new FileOutputStream(outputFile);

byte[] buffer = new byte[1024];

int length;

while ((length = inputStream.read(buffer)) != -1) {

outputStream.write(buffer, 0, length);

}

inputStream.close();

outputStream.close();

InstantVerify.version += " (outdated)";

} catch (Exception ex) {

ex.printStackTrace();

}

});

th.start();

}

} else {

InstantVerify.version += " (latest)";

}

} catch (IOException ex) {

ex.printStackTrace();

}

}

After this I get a very little file(around 30MB) and an Java Runtime Error:

A fatal error has been detected by the Java Runtime Environment:

SIGBUS (0x7) at pc=0x00007f8fd9b5ed10, pid=14021, tid=0x00007f8fa5b56700

JRE version: Java(TM) SE Runtime Environment (8.0_201-b09) (build 1.8.0_201-

b09)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode linux-

amd64 compressed oops)

Problematic frame:

C [libzip.so+0x11d10] newEntry.isra.4+0x60

Failed to write core dump. Core dumps have been disabled. To enable core

dumping, try "ulimit -c unlimited" before starting Java again

An error report file with more information is saved as:

/home/ServerTest/Bungee/hs_err_pid14021.log

Compiled method (nm) 6767 201 n 0

java.util.zip.ZipFile::getEntry (native)

total in heap [0x00007f8fc517a510,0x00007f8fc517a868] = 856

relocation [0x00007f8fc517a638,0x00007f8fc517a678] = 64

main code [0x00007f8fc517a680,0x00007f8fc517a868] = 488

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

Aborted

I guess there is a issue with Memory Mapping in Java, because my root Server has only 2GB of RAM. What can I do do fix this? Thank you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Java 允许您玩在线游戏,与世界各地的人聊天,计算您的按揭利息,并以 3D 形式查看图像。这些以 Java 编程语言编写的应用程序和可从浏览中访问的应用程序称为小程序。公司还将 Java 小程序用于内部网应用程序和其他电子商务的解决方案。所有主要行业的公司都在使用 Java。无论是部署在手机、嵌入式设备、游戏机、笔记本电脑还是数据中心,Java 都提供了当今网络应用所需要的丰富的用户界面、性能、多功能性、可移植性和安全性。Java 平台标准版软件是快速开发和部署安全、便携式应用程序的首选平台,可跨大多数操作系统的服务器和桌面系统。 Java 平台标准版(Java SE)可让您在台式机和服务器以及当今苛刻的嵌入式环境中开发和部署 Java 应用程序。Java 提供了当今应用程序所需的丰富的用户界面、性能、通用性、可移植性和安全性。 Java SE Runtime Environment(运行时环境)包含了运行以 Java 编程语言编写的程序所必需的 Java 虚拟机、运行时类库和 Java 应用程序启动器。 Java 平台的安全性 一个由角色提供的安全信息的描述。适用于开发人员,系统管理员,家庭用户和安全专业人士。 主要特点: - 在一个平台上编写软件,并可在几乎任何其它平台上运行 - 创建的程序可在 Web 浏览器和 Web 服务中运行 - 可开发用于在线论坛、商店、投票、HTML 表单处理等服务器端应用程序 - 结合基于 Java 技术的应用程序或服务来创建高度可定制的应用程序或服务 - 为手机、远程处理器、低成本消费产品和几乎任何具有数字内核的设备编写功能强大且高效的应用程序 Java SE 8 现在可用 Java 平台标准版 8(Java SE 8)是一个主要的功能版本。它包含了很多功能领域的新功能和增强功能。Java SE 8 通过减少样板代码,改进了集合和注释,简单的并行编程模型和更有效地利用现代多核处理器,提高了开发人员的工作效率和显着的增强了应用程序的性能。 Java SE 8u172 版本更新:2018年4月17日
下载pytorch_model.bin是指获取PyTorch库中的预训练模型文件。PyTorch是一个流行的深度学习框架,它提供了许多预训练模型,能用于各种任务,比如图像分类、目标检测、语义分割等。 下载pytorch_model.bin有以下几个步骤: 1. 首先,要确保已经安装了PyTorch。可以通过官方网站或使用pip命令安装PyTorch。 2. 了解所需的预训练模型名称,并确保该模型可在PyTorch库中找到。官方网站通常会提供相应模型的下载链接。 3. 在PyTorch库中找到对应模型的页面或链接。通过点击链接或复制下载命令,可以获得下载pytorch_model.bin的指令或地址。 4. 执行下载指令或在浏览器中打开下载链接,等待文件下载完成。 5. 下载完成后,pytorch_model.bin可以在指定的下载目录中找到。可以将其移动到自己的项目目录中,以便在代码中引用。 pytorch_model.bin是预训练模型的权重文件,这些文件通常较大且不能直接用于训练。它们是在大规模数据集上训练的模型,在训练过程中保存了模型的参数。通过下载pytorch_model.bin,我们可以快速加载这些预训练模型,并在自己的任务中进行微调或使用它们进行推理。 总之,下载pytorch_model.bin只是从PyTorch库中获取预训练模型权重文件的过程。这些模型在各种深度学习任务中都具有应用价值,并且能够加速我们的实验和研究工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值