博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java.nio.BufferOverflowException
阅读量:4079 次
发布时间:2019-05-25

本文共 4895 字,大约阅读时间需要 16 分钟。

Bug ID: 6526175
Votes 0
Synopsis Compiler throws BufferOverflowException should say that it ran out of memory
Category java:compiler
Reported Against  
Release Fixed
State 5-Cause Known, request for enhancement
Priority: 3-Medium
Related Bugs
Submit Date 16-FEB-2007
Description
FULL PRODUCT VERSION :java version "1.6.0"Java(TM) SE Runtime Environment (build 1.6.0-b105)Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)ADDITIONAL OS VERSION INFORMATION :windows xp service pack 2A DESCRIPTION OF THE PROBLEM :i use maven to compile struts source code , it always throw  the BufferOverflowException.ERROR MESSAGES/STACK TRACES THAT OCCUR :java.nio.BufferOverflowException        at java.nio.Buffer.nextPutIndex(Buffer.java:495)        at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:145)        at com.sun.tools.javac.util.DefaultFileManager.decode(DefaultFileManager.java:726)        at com.sun.tools.javac.util.DefaultFileManager.access$300(DefaultFileManager.java:72)        at com.sun.tools.javac.util.DefaultFileManager$RegularFileObject.getCharContent(DefaultFileManager.java:1243)        at com.sun.tools.javac.util.DefaultFileManager$RegularFileObject.getCharContent(DefaultFileManager.java:1142)        at com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:483)        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)        at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:801)        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)        at com.sun.tools.javac.main.Main.compile(Main.java:353)        at com.sun.tools.javac.main.Main.compile(Main.java:279)        at com.sun.tools.javac.main.Main.compile(Main.java:270)        at com.sun.tools.javac.Main.compile(Main.java:87)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)        at java.lang.reflect.Method.invoke(Method.java:597)        at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:400)        at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:136)        at org. customer .maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:483)        at org. customer .maven.plugin.CompilerMojo.execute(CompilerMojo.java:111)        at org. customer .maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)        at org. customer .maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)        at org. customer .maven.DefaultMaven.doExecute(DefaultMaven.java:322)        at org. customer .maven.DefaultMaven.execute(DefaultMaven.java:115)        at org. customer .maven.cli.MavenCli.main(MavenCli.java:256)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)        at java.lang.reflect.Method.invoke(Method.java:597)        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)REPRODUCIBILITY :This bug can be reproduced always.Posted Date : 2007-02-16 22:55:14.0
Work Around
N/A
Evaluation
This is not a bug in the compiler.  The compiler runs out of memory and theresolution is to increase heap size.However, the compiler should provide better diagnostics for such problems andI have accepted this as a request for enhancement

 

题:

在使用maven构建Java开源项目,有时候会遇到BufferOverflowException异常(异常详细信息见后面)。

是Bug吗?

在sun的网站上有jdk 1.4.2和jdk 1.6.0 的bug报告,其实这个问题在 jdk 1.5.0_10和jdk 1.5.0_11中也有.

虽然sun不认为这是一个bug,解决建议是增加heap size,就是设置环境变量,增加内存的使用参数值;经过测试,这种解决方法不能有效消除错误的产生。

其他人是如何解决的?

从google中找到在其他的apache的项目中出现过同样的异常,但是都没能解决。

问题产生的原因?

可能原因是由于字符集使用GBK、UTF-8或者UTF-16导致使用多字节存放字符,内存使用增加,堆(heap)的尺寸无法提供程序所需的空间,造成异常。更深入的分析还在进行中。

解决方法:

将操作系统的区域和语言选项中的区域设置为 English 即可!

辅助的方法是在系统环境变量中增加设置: MAVEN_OPTS=-Xmx512m

posted on 2010-06-29 09:17 阅读(...) 评论(...)

转载地址:http://eepni.baihongyu.com/

你可能感兴趣的文章
Nginx篇-Nginx配置动静分离
查看>>
缓存篇-Redis缓存失效以及解决方案
查看>>
缓存篇-使用Redis进行分布式锁应用
查看>>
缓存篇-Redisson的使用
查看>>
phpquery抓取网站内容简单介绍
查看>>
找工作准备的方向(4月22日写的)
查看>>
关于fwrite写入文件后打开查看是乱码的问题
查看>>
用结构体指针前必须要用malloc,不然会出现段错误
查看>>
Linux系统中的美
查看>>
一些实战项目(linux应用层编程,多线程编程,网络编程)
查看>>
我觉得专注于去学东西就好了,与世无争。
查看>>
原来k8s docker是用go语言写的,和现在所讲的go是一个东西!
查看>>
STM32CubeMX 真的不要太好用
查看>>
STM32CubeMX介绍、下载与安装
查看>>
电机和桨叶要搭配选择
查看>>
现在发现如果无人机的电机不同,浆可能是不能混用的。
查看>>
不要买铝合金机架的无人机,不耐摔,易变形弯曲。
查看>>
ACfly也是基于FreeRTOS的
查看>>
F330装GPS的位置
查看>>
我想先用三个或者五个激光测距做无人机的室内定位和避障
查看>>