Hi 

I have reproduced it yesterday as well.
Thanks for the Jira Freeman, I will try to work on it tonight or tomorrow.

Regards
JB


-------- Original message --------
From: Freeman Fang <[email protected]> 
Date:16/12/2014  08:46  (GMT+01:00) 
To: [email protected] 
Cc:  
Subject: Re: 60,000+ 
org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects in the 
HeapDump. Why? 

FYI, I can reproduce it and create KARAF-3415[1] to track it, and I'm on it

[1]https://issues.apache.org/jira/browse/KARAF-3415
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat



On 2014-12-11, at 下午10:54, Paul Spencer wrote:

JB,
Have you been able to reproduce the issue?

Paul Spencer


On Dec 9, 2014, at 2:30 PM, Jean-Baptiste Onofré <[email protected]> wrote:

Thanks Paul,

I gonna investigate this issue.

Regards
JB

On 12/09/2014 08:23 PM, Paul Spencer wrote:
JB,
One way to reproduce this issue:
- Start Karaf with bin/karaf
- Dump the Heap Memory with a tool like jmap
- Open a second command shell and execute the following command several times:
  $KARAF_HOME/bin/client -u karat instance:list
- Dump the Heap Memory with a tool like jmap into a second output file
- Compare the two files with the Eclipse Memory Analyzer

Paul Spencer


On Dec 9, 2014, at 12:52 PM, Jean-Baptiste Onofré <[email protected]> wrote:

Can you try to session.close(false) just in case after the waitFor on the 
channel ?

Regards
JB

On 12/09/2014 06:46 PM, Paul Spencer wrote:
I have a test case that connects to a Karaf 3.0.2 server via SSH to
reset the environment prior to making WebService calls to the server.
After upgrading from Karaf 2.3.4 I started noticing
"java.lang.OutOfMemoryError: Java heap space” errors. In looking around
I noticed 60,000+
org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects
in the HeapDump when the Karaf server had only run a few rounds of testing.

1) Although I have searched without finding a definitive answer, Is this
a known issue?

2) I am using the default Karaf 3.0.2 installation with cxf-jaxbws and
some custom bundles. In addition to the attached screen image from the
Eclipse Memory Analyzer, what additional information should I provided?

***
* Code to programmatically connect to Karaf via ssh and issue reset
commands.
***
String host = “localhost”;
int port = 8101;
String user = "karaf";
String password = "karaf";

SshClient client = null;
String line = null;
try {
client = SshClient.setUpDefaultClient();
client.start();
ConnectFuture future = client.connect(user, host, port);
future.await();
ClientSession session = future.getSession();
session.addPasswordIdentity(password);
session.auth().verify();
ClientChannel channel = session.createExecChannel(command);
InputStream is = new FileInputStream("/dev/null");
PipedInputStream pi = new PipedInputStream();
PipedOutputStream po = new PipedOutputStream(pi);
InputStreamReader isr = new InputStreamReader(pi);
LineNumberReader lr = new LineNumberReader(isr);
channel.setIn(is);
channel.setOut(po);
channel.setErr(System.err);
channel.open();
channel.waitFor(ClientChannel.CLOSED, 0);
line = lr.readLine();

lr.close();
is.close();
} catch (InterruptedException e) {
e.printStackTrace();
throw e;
} catch (IOException e) {
e.printStackTrace();
throw e;
} catch (Exception e) {
e.printStackTrace();
throw e;
} finally {
client.stop();
}


Paul Spencer


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com


-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com


Reply via email to