[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
client logger output duplicated with multiple applets  XML
Forum Index -> Development
Author Message
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

To enhance repeated opening of the eclnt applet, we use the option separate_jvm=false.
Now the user can close the captain applet, move to a different page, then come back to a page containing the captain applet. When there was not too much delay between invocations, the 1.6-sun-java-plugin keeps the java.exe in memory and reuses it - this saves 1-2 sec startup time.

Now to our problem:
with each new eclnt applet, the console output is duplicated, since each applets adds a console handler to java's logger, but never removes it when the applet is closed.

Manfred
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

yes, this is something we can fix...
Will be part of next update.

Regards, Björn

PS: of course we "love" the separate-VM for each applet, because of esnuring total encapsulation (e.g. is the area of static variables...)... - but we will follow problems as well, when starting multiple applets in the same VM.

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

just to make sure...: we only can reproduce this, if using the "file-logging" (client parameter clientlogfile=...). If this is NOT reflecting your scenario, then please tell us.

Regards, Björn

Björn Müller, CaptainCasa GmbH
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

I am afraid the problem is there all the time, regardless of the file log parameter. Probably caused by the static initializer of class CLog.

Manfred
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hmm,

it's static, so it should only be called once - this is also what I "measure". Hmmm, hmmm. The update because of the file-log is part of today's version. Maybe this has some magic inside...

Regards, Björn

Björn Müller, CaptainCasa GmbH
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

update of current state:
the problem was not gone with the 10/10/2011 update.
Since we are also adding a customized appender (...which of course has the same problem...), we first thought that it is indirectly causing this problem on the console logger, but this was not the case.

Then playing further with our applet code we found the applet property Code:
classloader_cache=aBoolean
. It was set to false in our original scenario when the problem appears. When we change it to true, the duplication is gone. This new setting also has the advantage that the eclient loads faster, but we are not yet sure about complications we might face at other places.

Manfred
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

Here is one more update of our findings regarding class loaders and java.exe's and applets:

When a page contains two applets (invoked from different servers), or contains one location where an applet is switched between two servers (so that there is only one applet active at one time), we again have the situation that the core java classes like String and Logger exist only once, but there are two class loaders which each load the different eclient classes.

So in this situation we have again the sitation that CLog registers two output handlers for logger "org.eclnt.clientlog", and never removes them.

Contrary to the situation described in the first message, when we now use the flag classloader_cache=true this duplication only occurs once for every different server a user visits, and since these are probably very few (two, three,...), this duplication is not getting ever more severe as a user repeatedly starts and stops the eclient applet during her daily work.

Still we would appreciate some code in CLog class that first examines if the logger already has a suitable appender, and only create a new one if none is found.

regards
Manfred
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team