When X clients request the same jsp page, jasper tries to compile the page X times ( assuming the page was not compiled before) this leads to very high memory usage and potentially to out of memory errors (even if memory would normally be sufficient for the expected load). Using jikes as a compiler reduces the overall memory problem, but still swamps the processor as X copies are run at the same time. Is this the expected behaviour?
I tried to work around this problem by synchronizing access to the java compiler, however this only reduces the problem. since the java sourcecode is generated again and again until it compiles. So 1 thread is busy compiling while another is trying to overwrite the source code. Scenario: 2 clients access the same page at approximately the same time Thread 1: Generate Java code ( class not found ) Thread 2: Generate Java code ( class not found ) Thread 1: write classfile to disk Thread 2: write classfile to dist ( fails because file is in use ) Thread 1: Generate Java code ( source is newer because of Thread 2 ) Thread 1: Compile Java code ( again! )
So maybe this is not a "synchronize" scenario. Maybe a semaphore status should be included on Jasper to take out this behavour.
Fixed in jasper2.