[Design of EJB 3.0] - Re: Classloading problem in proxy factories
by bstansberry@jboss.com
"ALRubinger" wrote :
| I also tried running the test on my Win32 partition using JBossProfiler, which can force a GC via its JMVTIInterface. However, this resulted in lots of:
|
| [JVMTIInterface] 4069000 references received
|
| ...followed by OutOfMemoryErrors.
|
I guess there's a reason my writing those tests turned into my debugging all the leaks they found. Until you didn't run away from the tarbaby fast enough. Not very easy; requires a fair bit of black art, like w/ AS 5 you have to increase the heap. :(
Anyway, re: the transient failures, one thing that's odd here is it's the same test that fails, but others don't in the same test class don't. The other tests are basically doing the same things, it's just that the EJB they invoke upon is packaged differently (in an ear, in an ear with a scoped classloader, etc.) But the way the remoting layer handles the calls should be identical between the tests. So why is testSimpleEjb the only one that fails?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175148#4175148
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175148
17 years, 7 months
[Design of Messaging on JBoss (Messaging/JBoss)] - QueueImipl::deliverAsync
by clebert.suconic@jboss.com
Looking at deliverAsyn, there is an AtomicBoolean that should be used to only allow one thread being executed at any time. (It should give up the execution on any other thread).
public void deliverAsync(final Executor executor)
| {
| //Prevent too many executors running at once
|
| if (waitingToDeliver.compareAndSet(false, true))
| {
| executor.execute(deliverRunner);
| }
| }
|
DeliverRunning is then setting the boolean to false before even starting the deliver.
private class DeliverRunner implements Runnable
| {
| public void run()
| {
| //Must be set to false *before* executing to avoid race
| waitingToDeliver.set(false);
|
| deliver();
| }
| }
|
Shouldn't waitingToDeliver boolean be set to false *after* the deliver was called?
private class DeliverRunner implements Runnable
| {
| public void run()
| {
| try
| {
| deliver();
| }
| finally
| {
| waitingToDeliver.set(false);
| }
| }
| }
|
I simulated this on a simple test, and I would aways have multiple threads executing my method if set was called before.
|
|
| public class MultiStartTest
| {
| static AtomicBoolean waitingControl = new AtomicBoolean(false);
|
| static AtomicInteger counter = new AtomicInteger(0);
|
| static final int NUMBER_OF_THREADS = 100;
|
| static CountDownLatch latchAlign = new CountDownLatch(NUMBER_OF_THREADS);
|
| static CountDownLatch latchStart = new CountDownLatch(1);
|
| static CountDownLatch latchWait = new CountDownLatch(1);
|
|
|
| public static void execute() throws Exception
| {
| if (waitingControl.compareAndSet(false, true))
| {
|
| // waitingControl.set(false); If you re-enable this line, multiple threads will be executing the critical area
|
| if (counter.addAndGet(1)>1)
| {
| System.out.println("Multiple threads are executing this critical area ( counter = " + counter.get() + ")");
| }
|
| latchWait.await(); // Simulating some work being done.
|
| counter.addAndGet(-1);
| waitingControl.set(false);
| }
|
| }
|
|
| static class TRun extends Thread
| {
| public void run()
| {
| try
| {
| latchAlign.countDown();
| latchStart.await();
|
| MultiStartTest.execute();
| }
| catch (Throwable e)
| {
| e.printStackTrace();
| }
| }
| }
|
|
| public static void main(String arg[])
| {
| try
| {
| ArrayList<TRun> threads = new ArrayList<TRun>();
| for (int i = 0; i < NUMBER_OF_THREADS; i++)
| {
| TRun t = new TRun();
| t.start();
| threads.add(t);
| }
|
| latchAlign.await();
| latchStart.countDown();
|
| latchWait.countDown();
|
| for (Thread t: threads)
| {
| t.join();
| }
|
|
| }
| catch (Exception e)
| {
| e.printStackTrace();
| }
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175142#4175142
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175142
17 years, 7 months
[Design of JBoss Portal] - Portal 2.7.0 Beta1 error PermGen Space
by bjoernb
hi when i start the portal 2.7.0 beta 1 everything is fine but when i login as admin and want to click Administrator to get into the Administration menu i get the following stackstrace
2008-09-08 19:04:24,192 DEBUG [org.jbpm.JbpmContext] end jta transation with COMMIT
2008-09-08 19:04:24,192 DEBUG [org.jbpm.svc.Services] closing service 'tx': org.jbpm.tx.TxService@c3fc68
2008-09-08 19:04:24,242 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/portal-core].[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:690)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:670)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:200)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:527)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:508)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:584)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:214)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:602)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:411)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:405)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
i am using jboss-portal-2.7.0.B1-bundled.zip which already includes the run.conf with -XX:MaxPermSize=256m configuration... does anyone have a clue ?
thx in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175125#4175125
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175125
17 years, 7 months