[Performance Tuning] - Sudden increase in Jboss memory
by augustinm
Hi,
I am using JBoss 4.0.5.GA. I have 8 EJBs deployed in that server. Java Swing application is talking to this server. Toplink is used to talk to the database[oracle].
Xms and mx are set as 512 and 1024.
Jboss normally uses around 250Mb and the application just runs fine. The JBoss server is restarted every morning.
Every now and then, within a matter of seconds, JBoss would go from 250Mb to 1024Mb and stop responding to user calls.
I checked the logs to check on all the requests that came in before JBoss stopped responding. Ther are no issues there.
I just couldnot tell why Jboss would max out the menory all of a sudden.
For some reason, it does ont throw OOM error either. It just stays there and occupies all the CPU and memory and stops responding.
It is not a memory leak as it does not increase gradually. It just happens suddenly. More over, it does not happen every day. Users do the same thing everyday. So, I know for sure it is not related to what the user is doing.
I could not reproduce in test environment.
Hence, I could not really add profiler and reduce the performance in Production.
Any thoughts?
--augustinm
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221094#4221094
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221094
17 years
[Installation, Configuration & DEPLOYMENT] - Re: Log message to screen - possible in Weblogic, is it poss
by valatharv
I performed these steps but no success, please suggest what I am doing wrong :
a) jboss-4.2.3\server\default\conf\jboss-log4j.xml
server.log is getting created under "jboss-4.2.3\server\default\logfiles"
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
| <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="Threshold" value="INFO"/>
|
| <param name="File" value="${jboss.server.home.dir}/logfiles/server.log"/>
|
| <echo message="${jboss.server.log.dir}" />
| <param name="Append" value="false"/>
| <param name="DatePattern" value="'.'yyyy-MM-dd"/>
| <layout class="org.apache.log4j.PatternLayout">
| <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
| </layout>
| </appender>
b) jboss-4.2.3\server\default\deploy\jboss-web.deployer\server.xml
<Connector port="80" address="${jboss.bind.address}"
| maxThreads="250" maxHttpHeaderSize="8192"
| emptySessionPath="true" protocol="HTTP/1.1"
| enableLookups="false" redirectPort="8443" acceptCount="100"
| connectionTimeout="20000" disableUploadTimeout="true" />
|
| <Context path="/logfiles" docBase="log" debug="0" reloadable="true" />...........
c) Tried URL anonymous wrote : http://localhost/log/server.log
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221091#4221091
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221091
17 years
[JBoss jBPM] - Re: Recommended way to purge finished process instances
by bradsdavis
Hello. I have created a POJO JMX MBean that uses the jBPM API to do something similar.
Compiling this will produce a JAR. Put that JAR into the deploy directory of the server, where the jBPM libraries are also on the server's classpath. If you bring up the JMX management console, you should find the JbpmManagementBean. There, you will find some convenience method to cleanup old processes and process instances.
Cheers.
See below:
| package com.amentra.support.jmx.jbpm.management;
| import java.math.BigDecimal;
| import java.util.Calendar;
| import java.util.Date;
| import java.util.List;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.hibernate.Query;
| import org.hibernate.Session;
| import org.jboss.annotation.ejb.Management;
| import org.jboss.annotation.ejb.Service;
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
|
| @Service
| @Management(JbpmManagement.class)
| public class JbpmManagementBean implements JbpmManagement {
| private static final Log log = LogFactory.getLog(JbpmManagementBean.class);
| JbpmConfiguration configuration = null;
|
| /* (non-Javadoc)
| * @see com.ccna.jmx.jbpm.management.JbpmManagement#removeAllProcessesBefore(java.util.Date)
| */
| public void removeAllProcessesBefore(Date date)
| {
| if (log.isDebugEnabled()) {
| log.debug("Removing all processes before: "+date);
| }
|
| if(configuration==null)
| {
| configuration = JbpmConfiguration.getInstance();
| }
| JbpmContext context = configuration.createJbpmContext();
|
| try{
| Session hibernateSession = context.getSession();
| Query processQuery = hibernateSession.createQuery("from org.jbpm.graph.exe.ProcessInstance pi where pi.start < :removalDate");
| processQuery.setParameter("removalDate", date);
|
| List<ProcessInstance> instances = processQuery.list();
|
| if(instances!=null&&instances.size()>0)
| {
| if (log.isDebugEnabled()) {
| log.debug("Total number of processes to remove: "+instances.size());
| }
| for(ProcessInstance instance : instances)
| {
| if (log.isDebugEnabled()) {
| log.debug("Removing process instance: "+instance.getId());
| }
| //Loop over the instances and remove them.
| context.getGraphSession().deleteProcessInstance(instance);
| }
| }
| else
| {
| log.debug("No instances found to remove.");
| }
| }
| finally {
| context.close();
| }
|
| log.debug("Completed removal process.");
|
| }
|
| /* (non-Javadoc)
| * @see com.ccna.jmx.jbpm.management.JbpmManagement#create()
| */
| public void create() throws Exception {
| log.debug("Creating Jbpm Management JMX bean.");
| }
|
| /* (non-Javadoc)
| * @see com.ccna.jmx.jbpm.management.JbpmManagement#destroy()
| */
| public void destroy() {
| log.debug("Destroying Jbpm Manangement JMX bean.");
| }
|
| public void removeAllProcessesThreeYearsOld() {
| //Get todays date.
| Calendar c = Calendar.getInstance();
| c.setTime(new Date());
| c.add(Calendar.YEAR, -3);
|
| Date threeYearsAgoFromToday = c.getTime();
|
| removeAllProcessesBefore(threeYearsAgoFromToday);
|
| }
|
| @Override
| public void removeAllProcessesBeforeToday() {
| //Get todays date.
| Calendar c = Calendar.getInstance();
| c.setTime(new Date());
| c.add(Calendar.DAY_OF_MONTH, -1);
|
| Date threeYearsAgoFromToday = c.getTime();
|
| removeAllProcessesBefore(threeYearsAgoFromToday);
| }
|
| @Override
| public void removeAllOldProcessDefinitions() {
| if (log.isDebugEnabled()) {
| log.debug("Removing all old versionned process definitions. Cascading.");
| }
|
| if(configuration==null)
| {
| configuration = JbpmConfiguration.getInstance();
| }
| JbpmContext context = configuration.createJbpmContext();
|
| try{
| Session hibernateSession = context.getSession();
|
| Query query = hibernateSession.createSQLQuery("select q2.id_ from (select name_,max(version_) as max_version from jbpm_processdefinition group by name_) q1, "+
| "(select id_,name_,version_ from jbpm_processdefinition) q2 "+
| "where q2.name_ = q1.name_ AND q2.version_ <> q1.max_version");
|
| List<BigDecimal> definitions = query.list();
|
| if(definitions!=null)
| {
| if (log.isDebugEnabled()) {
| log.debug("Found "+definitions.size()+" definitions to remove.");
|
| for(BigDecimal definitionId : definitions)
| {
| if (log.isDebugEnabled()) {
| log.debug("Removing definition: "+definitionId);
| }
| ProcessDefinition definition = context.getGraphSession().getProcessDefinition(definitionId.longValue());
|
| if (log.isDebugEnabled()) {
| log.debug(" + Definition Name: "+definition.getName()+", Version: "+definition.getVersion());
| }
|
| context.getGraphSession().deleteProcessDefinition(definition);
| }
| }
| }
| else
| {
| log.debug("No old process definitions found to remove.");
|
| }
|
| }
| finally {
| context.close();
| }
|
| log.debug("Completed removal process.");
|
| }
|
| }
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221078#4221078
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221078
17 years