[JBoss JIRA] (JBAS-9468) JVM out of memory and memory leak error
by karthikeyan G (JIRA)
karthikeyan G created JBAS-9468:
-----------------------------------
Summary: JVM out of memory and memory leak error
Key: JBAS-9468
URL: https://issues.jboss.org/browse/JBAS-9468
Project: Application Server 3 4 5 and 6
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Clustering
Affects Versions: JBossAS-4.2.2.GA
Environment: Windows 2003 SP2 , 10 GB RAM, Java 1.5.0_22.
Reporter: karthikeyan G
Assignee: Paul Ferraro
Priority: Critical
Fix For: JBossAS-4.2.2.GA
We are getting JVM out of memory and memory leak errors frequently.
We have made adjustments on JAVA_OPTIONS and now the setting is
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xms512m -Xmx1200m -XX:NewRatio=3 -XX:PermSize=256m -XX:MaxPermSize=256m -XX:SurvivorRatio=4.
Still we are getting memory error, if the load increases (Concurrancy more than 700) . Please suggest with the solution for this.
Thanks
Rengaraj.V
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] (JBAS-9469) Service temporary unavailable
by karthikeyan G (JIRA)
karthikeyan G created JBAS-9469:
-----------------------------------
Summary: Service temporary unavailable
Key: JBAS-9469
URL: https://issues.jboss.org/browse/JBAS-9469
Project: Application Server 3 4 5 and 6
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Clustering, Deployers, JMX
Affects Versions: JBossAS-4.2.2.GA
Environment:
Windows 2003 SP2 , 10 GB RAM, Java 1.5.0_22.
Reporter: karthikeyan G
Assignee: Paul Ferraro
Priority: Critical
Fix For: JBossAS-4.2.2.GA
Attachments: service unavialble.png
We are geeting "Service temporary unavailable" mesggage very often if the concurancy increases more than 500 users in our application. We are using Jboss 4.2.2 and SQL server 2005 as DB. As per our observastion this error is because of high load. Our application concurrancy will exceed more than 1000. Please help us to fix this issue. I have attached teh errror screen.
Thanks
Rengaraj.V
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBSER-117) Problem with JBoss serializing of dynamic proxies
by Maksym Ivanchenko (JIRA)
Problem with JBoss serializing of dynamic proxies
-------------------------------------------------
Key: JBSER-117
URL: https://jira.jboss.org/jira/browse/JBSER-117
Project: JBoss Serialization
Issue Type: Bug
Affects Versions: 1.0.3 GA
Reporter: Maksym Ivanchenko
Assignee: Clebert Suconic
When we try to serialize a proxy that contains some child entity which points to proxy itself the following exception occurs:
org.jboss.serial.exception.SerializationException: Object reference 1 was not found
Simple test case for problem reproducing:
import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import org.jboss.serial.io.JBossObjectOutputStream;
import org.junit.Test;
public class StandaloneProxySerializationTest {
@Test
public void testSerialization() throws Exception {
ISampleEntity entity = new SampleEntityImpl();
Class<?>[] interfaces = new Class<?>[] {ISampleEntity.class};
SampleEntityInvocationHandler handler = new SampleEntityInvocationHandler(entity);
ISampleEntity proxy = (ISampleEntity) Proxy.newProxyInstance(Thread.currentThread()
.getContextClassLoader(), interfaces, handler);
ISampleEntity childEntity = new SampleEntityImpl();
proxy.setChild(childEntity);
childEntity.setParent(proxy);
JBossObjectOutputStream jbossSerializer = new JBossObjectOutputStream(null);
jbossSerializer.smartClone(proxy);
}
private static interface ISampleEntity {
public ISampleEntity getParent();
public void setParent(ISampleEntity parent);
public ISampleEntity getChild();
public void setChild(ISampleEntity child);
}
private static class SampleEntityImpl implements ISampleEntity, Serializable {
private static final long serialVersionUID = 1L;
private ISampleEntity parent;
private ISampleEntity child;
@Override
public ISampleEntity getParent() {
return parent;
}
@Override
public void setParent(ISampleEntity parent) {
this.parent = parent;
}
@Override
public ISampleEntity getChild() {
return child;
}
@Override
public void setChild(ISampleEntity child) {
this.child = child;
}
}
private static class SampleEntityInvocationHandler implements InvocationHandler, Serializable {
private static final long serialVersionUID = 1L;
private ISampleEntity entity;
public SampleEntityInvocationHandler(ISampleEntity entity) {
this.entity = entity;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(entity, args);
}
}
}
Upon ivestigating this issue we found that the problem is in ProxyPersister.readData() method. It reads the handler, the proxy class, constructs a proxy and only then puts it to cache. But if a proxy data contains proxy itself then it tries to find it by reference (which is not in cache yet, because the handler is still being read). So it throws "Object reference not found" exception.
We worked around this problem by introducing an InvocationHandler wrapper in ProxyPersister:
Patched ProxyPersister.java:
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.serial.persister;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import org.jboss.serial.classmetamodel.ClassMetaData;
import org.jboss.serial.classmetamodel.StreamingClass;
import org.jboss.serial.exception.SerializationException;
import org.jboss.serial.objectmetamodel.ObjectSubstitutionInterface;
import org.jboss.serial.objectmetamodel.ObjectsCache;
/**
* $Id: ProxyPersister.java,v 1.11 2006/04/24 23:49:40 csuconic Exp $
*
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*/
public class ProxyPersister implements Persister {
private byte id;
public byte getId() {
return id;
}
public void setId(byte id) {
this.id = id;
}
public void writeData(ClassMetaData metaData, ObjectOutput output, Object obj, ObjectSubstitutionInterface substitution) throws IOException{
Object handler = Proxy.getInvocationHandler(obj);
output.writeObject(obj.getClass());
output.writeObject(handler);
}
static class InvocationHandlerWrapper implements InvocationHandler {
private InvocationHandler wrappedHandler;
public void setWrappedHandler(InvocationHandler wrappedHandler) {
this.wrappedHandler = wrappedHandler;
}
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return wrappedHandler.invoke(proxy, method, args);
}
}
public Object readData (ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, ObjectInput input, ObjectSubstitutionInterface substitution) throws IOException{
try
{
Class proxy = (Class)input.readObject();
Constructor constructor = proxy.getConstructor(new Class[] { InvocationHandler.class });
InvocationHandlerWrapper wrapper = new InvocationHandlerWrapper();
Object obj = constructor.newInstance(new Object[]{wrapper});
cache.putObjectInCacheRead(referenceId,obj);
Object handler = input.readObject();
wrapper.setWrappedHandler((InvocationHandler) handler);
return obj;
}
catch (ClassNotFoundException e)
{
throw new SerializationException(e);
}
catch (NoSuchMethodException e)
{
throw new SerializationException(e);
}
catch (IllegalAccessException e)
{
throw new SerializationException(e);
}
catch (InstantiationException e)
{
throw new SerializationException(e);
}
catch (InvocationTargetException e)
{
throw new SerializationException(e);
}
}
public boolean canPersist(Object obj)
{
// not implemented
return false;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] (AS7-2045) JdbcSQLException: "Database is already closed" on server shutdown
by Jozef Hartinger (Created) (JIRA)
JdbcSQLException: "Database is already closed" on server shutdown
-----------------------------------------------------------------
Key: AS7-2045
URL: https://issues.jboss.org/browse/AS7-2045
Project: Application Server 7
Issue Type: Bug
Affects Versions: 7.0.2.Final
Reporter: Jozef Hartinger
Priority: Critical
Fix For: 7.1.0.Beta1
An application that uses the "create-drop" Hibernate ddl strategy fails do undeploy properly on shutdown when a persistent (non-in-memory) database is used. Shutdown log below.
This issue is critical for the demo applications on *openshift express* (which uses persistent setup for the built-in database) where redeploy is expected to get the application to the default state.
To reproduce:
# Use the attached standalone-persistent.xml profile (the only change is redefinition of the built-in datasource URL to jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1)
# Deploy the attached application
# Start the server with the persistent profile (./standalone.sh --server-config=../standalone/configuration/standalone-persistent.xml)
# Stop the server (Ctrl+C)
# You should see the exception below
{noformat}
16:42:43,982 INFO [org.jboss.as.logging] Restored bootstrap log handlers
16:42:44,003 INFO [org.jboss.jpa] stopping Persistence Unit Service 'test.war#booking'
16:42:44,005 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] HHH00227:Running hbm2ddl schema export
16:42:44,014 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] HHH00231:Schema export unsuccessful: org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-145]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.message.DbException.get(DbException.java:133)
at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1333)
at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1308)
at org.h2.jdbc.JdbcConnection.setAutoCommit(JdbcConnection.java:364)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.checkTransaction(BaseWrapperManagedConnection.java:810)
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:1567)
at org.jboss.jca.adapters.jdbc.WrappedConnection.createStatement(WrappedConnection.java:295)
at org.hibernate.tool.hbm2ddl.DatabaseExporter.<init>(DatabaseExporter.java:54)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:354)
at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:305)
at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:301)
at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1288)
at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:126)
at org.jboss.as.jpa.service.PersistenceUnitService.stop(PersistenceUnitService.java:88) [jboss-as-jpa-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1909) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1872) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
16:42:44,018 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] HHH00230:Schema export complete
16:42:44,022 INFO [com.arjuna.ats.jbossatx] ARJUNA32018: Destroying TransactionManagerService
16:42:44,028 INFO [com.arjuna.ats.jbossatx] ARJUNA32014: Stopping transaction recovery manager
16:42:44,030 INFO [org.jboss.as.server.deployment] Stopped deployment test.war in 68ms
16:42:44,032 INFO [org.jboss.as] JBoss AS 7.0.2.Final "Arc" stopped in 66ms
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months