Weblogic性能问题。。。。
为什么我的服务器上运行WEBLOGIC时要耗内存85M多,进程为java.exe
ORALCE则耗70M多。。。
大概才100个人访问。并发数最多5个。。。。
好慢呀。。。
我把WEBLOGIC设为开发模式,不知道这样会不会影响性能?
会不会是我的连接池问题?
public class ConnMgr {
private static ConnMgr connMgr = new ConnMgr();
private DataSource ds = null;
private Logger logger = Logger.getInstance();
public static ConnMgr getInstance() {
return connMgr;
}
public Connection getConnection() throws AppException{
try {
if (ds == null) {
InitialContext ic = new InitialContext();
ds = (DataSource) ic.lookup(JNDINames.DATASOURCE);
}
return ds.getConnection();
} catch( Exception e) {
e.printStackTrace();
logger.error("ConnMgr", "getConnection()", e.getMessage(), e);
throw new AppException("msg.CreateConnFailed");
}
}
public void begin(Connection conn) throws AppException {
try {
if (conn != null) {
conn.setAutoCommit(false);
}
} catch (Exception e) {
throw new AppException("msg.BeginTransFailed");
}
}
public void commit(Connection conn) throws AppException {
try {
if (conn != null) {
conn.commit();
}
} catch (Exception e) {
throw new AppException("msg.CommitTransFailed");
}
}
public void rollback(Connection conn) throws AppException {
try {
if (conn != null) {
conn.rollback();
}
} catch (Exception e) {
throw new AppException("msg.RollbackFailed");
}
}
public void close(Connection conn) throws AppException{
try {
if(conn!=null){
commit(conn);
conn.setAutoCommit(true);
if (!conn.isClosed()) {
conn.close();
}
}
} catch (Exception e) {
throw new AppException("msg.CloseConnFailed");
}
}
}
调用。。。。
public void addMovie(MovieModel model,MovieURLModel[] urlModel) throws AppException {
try {
conn = connMgr.getConnection();
connMgr.begin(conn);
MovieDAO movieDAO = new MovieDAO(conn);
String serialID = movieDAO.addMovie(model);
int count = urlModel.length;
for (int i=0;i<count;i++) {
urlModel[i].setString("movieID",serialID);
new MovieURLDAO(conn).addMovieURL(urlModel[i]);
}
connMgr.commit(conn);
} catch (AppException e) {
connMgr.rollback(conn);
logger.error("MovieBL","addMovie()","",e);
throw e;
} finally {
connMgr.close(conn);
}
}
问题点数:0、回复次数:3Top
1 楼coolwj(博得)回复于 2003-03-11 10:33:36 得分 0
关注,各位熟悉WebLogic的朋友能不能给些优化性能的方法?Top
2 楼geyf(其实我也不会)回复于 2003-03-13 17:46:20 得分 0
weblogic消耗85M已经算很少了,weblogic server没有客户端连接时的内存也在32-64M之间,何况你的上面还有应用,建议光是weblogic就要至少128M以上内存。而且oracle也是很耗资源的东东。所以最好的办法就是加内存,或分开weblogic和oracle。
另外,weblogic改为产品模式,可以提高一些性能。Top
3 楼zhx_232(笨狗熊妹妹)回复于 2003-03-19 20:17:24 得分 0
加内存
我也遇到这个问题,而且weblogic启动久了,就越来越慢了
不知道谁有更好的办法,在linux下面是不是会好一些呢?
公司的破机器都给别人用了,没有机器给我用了,
连试都不能试,真是郁闷Top




