JiveJdon Community Forums
在线234人 Home | 论坛 | 培训咨询 | 精华 | 查搜 | 注册 | 登陆 |
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表
???en_US.forumThreadNext.name??? 下一主题
这个主题共有 1 回复 / 1 页 [ ]  发表新帖子  回复该主题贴
wenyuqiu

发表文章: 2
注册时间: 2004年03月04日 13:04
给他发消息
tomcat的outofmemory,关于linux下的验证码 发表: 2004年08月03日 01:34 回复
本人在linux下开发了一个在内存中生成图片的小程序,由于没有启动xserver,所以java.awt包下很多东东都用不了,只能拐着弯实现,以至碰到了内存泄露的问题,请教各位高手帮一下忙!

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.awt.image.BufferedImage;
import javax.imageio.*;
import javax.imageio.stream.*;
public class AuthImage extends HttpServlet {


private static final int NUMBER[][]={

{-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,
-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,
-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,
1,1,1,-1,1,1,1,-1,-1,-1,1,
-1,-1,-1,1,1,1,-1,1,1,1,
1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,-1,
-1,1,1,1,-1,-1,-1,-1,1,1,1,
1,-1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,1,
1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,
1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,
1,1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,
1,1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,
-1,-1,1,1,1,-1,-1,-1,1,-1,-1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1,-1,1,-1,-1,-1,1,1,-1,-1,-1,1,1,1,
-1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,1,1,
1,-1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,1,
1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,-1,-1,
1,1,1,-1,-1,-1,-1,1,-1,1,1,1,
1,-1,-1,-1,1,1,1,-1,-1,-1,-1,1,
1,1,1,-1,-1,-1,-1,1,1,1,1,
1,1,1,-1,1,1,1,-1,
-1,-1,-1,1,-1,1,1,1,-1,1,1,
-1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,
1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,
1,-1,-1,1,1,1,-1,-1,-1,1,-1,-1,1,1,
1,-1,-1,-1,1,1,1,-1,-1,-1,-1,1,-1,
1,1,1,-1,-1,-1,1,1,1,1,-1,-1,-1,
-1,1,1,1,-1,-1,-1,1,-1,-1,1,1,1,
1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,
1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,
-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1}

};
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {



final int width=15, height=26,length=4;
BufferedImage bi=new BufferedImage(width*length,height,BufferedImage.TYPE_INT_RGB );
int a1=(int)(Math.random()*10);
int a2=(int)(Math.random()*10);
int a3=(int)(Math.random()*10);
int a4=(int)(Math.random()*10);
bi.setRGB(0*width,0,width,height,NUMBER[a1],0,width);
bi.setRGB(1*width,0,width,height,NUMBER[a2],0,width);
bi.setRGB(2*width,0,width,height,NUMBER[a3],0,width);
bi.setRGB(3*width,0,width,height,NUMBER[a4],0,width);


response.setContentType("image/jpeg");
ServletOutputStream outstream = response.getOutputStream();


Iterator ite = ImageIO.getImageWritersByFormatName("jpeg");
ImageWriter imageWriter = (ImageWriter) ite.next();

ImageOutputStream ios = ImageIO.createImageOutputStream(outstream);
imageWriter.setOutput(ios);
imageWriter.write(bi);
ios.flush();

imageWriter.dispose();
ios.close();
outstream.close();

}

public void destroy() {
}
}

请帮帮忙,这个小鸟让我的机器运行不到一天,tomcat就出现outofmemeory的致命问题。

/////////
//
//我少发言论,但我多关注
////
wenyuqiu

发表文章: 2
注册时间: 2004年03月04日 13:04
给他发消息
Re: tomcat的outofmemory,关于linux下的验证码 发表: 2004年08月03日 13:02 回复
:-(
没有人顶一下吗?
这个主题有 1 回复 / 1 页 [ ]
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表    返回页首  返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Spring Struts
查询本论坛内 回复超过的热门帖子
快速发表回复
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
 

解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-08 jdon.com

anti spam