- 浏览: 3896 次
- 性别:
- 来自: 北京
最新评论
文章列表
http://www.open-open.com/lib/view/open1383357856034.html
以下是原创作品,转载请标明出处http://lvjava.com/?p=383
今天运行J2EE项目的时候抛出异常:
Exception in thread “main” java.lang.OutOfMemoryError: PermGen spaceat java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClassCond(Unknown Source)
网上查找可知该异常产生的原因是JVM默认分配的4M运行空间过小,J2EE项目加载的类过多,造成内存溢出。
解决方案为通过 ...
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/x-download; charset=utf-8");//1
String imageDir = this.getServletContext().getRealPath("uploadfile/file")+"\\&qu ...
Double d = new Double("1234567890.12");
System.out.println("d:="+d);
java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
nf.setGroupingUsed(false);
System.out.println("d:="+nf.format(d));