Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.

How do you pass VM arguments to CP.exe?

BobK

This is a follow up to my post at "[SOLVED] ActiveMQ issues - Out of Memory - Server crashing" [SOLVED] ActiveMQ Issues - Out of Memory - Server crashing
I thought it needed its own thread.

The following are copies of relevant posts from that thread:

chris29 wrote

We have a similar issue. Found that you need to ensure that all log outputs are closed and put the following in the cp.ini at the end

-vmargs
-Xmx1024M

BobK wrote
chris29 wrote

We have a similar issue. Found that you need to ensure that all log outputs are closed and put the following in the cp.ini at the end

-vmargs
-Xmx1024M

Chris, are you sure that works?

I needed to pass an argument to the JVM and did some googling and found that the above is how you pass arguments to the eclipse JVM.
AwareIM is built on the eclipse framework but it is NOT eclipse.
When I put my argument in cp.ini like you did above, I did not get the result I was hoping for.
To get a better idea of what was being passed to JVM, I wrote a small java plug-in to display the arguments being used by the JVM and my argument was not displayed.
I also tried adding my argument to startAwareIM.bat. After restarting AwareIM with that old batch file, my argument was displayed.
After some experimentation, I found that adding my argument to startupOptions.props and starting AwareIM with cp.exe, my plug-in displayed my argument and I was able to get the results I needed with the argument set.

BLOMASKY wrote

I thought that was just used for the configurator.

1st question: What is the VARS folder used for?
2nd question: why does adding:
-vmargs
-Xmx1024M
to the end of the CP.ini do?

Thanks
Bruce

chris29 wrote

Adding vmargs to cp.ini was a recommendation from Vladimir and it works for our servers. The memory settings for aware/tomcat we have in startupOptions.props

Have a look at VisualVM, it will let you know what is happening with memory.

https://visualvm.github.io/download.html

Vladimir should know his product and I am certainly not saying he is wrong. But my observations appear to be inconsistent with the prevailing theory.

Maybe I am looking at it wrong or since my issue was not a memory issue it needs to be handled differently. Either way, I am asking if some one smarter than me could explain the discrepancy.

Here are the brutal details.

I have a process that uses URL_CONTENTS(<some service>) to return some data. (I have not updated to the new RESTful service yet.)
This was working great until earlier this month when I started receiving
com.bas.shared.ruleparser.ParseException Unable to connect to URL due to exception javax.net.ssl.SSLProtocolException handshake alert: unrecognized_name

I googled this error and my understanding of this issue is that the server I am calling is misconfigured and is returning a warning. Java does not like this warning and is throwing the above exception. If I take java out of the mix and make the call with a browser, The call works. So the issue is with the server and java. Since I can not control either of those, I have to use the suggested work around which is to add
-Djsse.enableSNIExtension=false
to the startup of the application (AwareIM)

When I put that option in CP.ini, I still get the error. When I put that option in the startupOptions.props file on the AWAREIM_SERVER_STARTUP line, the error goes away and I get the expected data.

Further investigation:

I created a plug-in with the following code:

public class vmargTest implements IProcess {


//@see com.bas.basserver.executionengine.IProcess#cancel()
public boolean cancel()
{
return true;
}


//@see com.bas.basserver.executionengine.IProcess#execute(com.bas.basserver.exe cutionengine.IExecutionEngine, java.lang.Object[])
public Object execute (IExecutionEngine engine, Object [] args)
throws SuspendProcessException, ExecutionException, AccessDeniedException
{
	RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
	List arguments = runtimeMxBean.getInputArguments();
	Iterator argsIt = arguments.iterator();
	
System.out.println("*****************************");
while (argsIt.hasNext()) {
	System.out.println(argsIt.next().toString());
}
System.out.println("*****************************");

return null;
}
}

I also created a process in AwareIM to run the plug-in. When the plug-in runs, the following is printed in the "Server Output"


-Djsse.enableSNIExtension=false
-Xmx1024m
-Xms20m


All 3 of these lines come form the startupOpions.props file. The CP.ini had different memory settings.

Can any body explain this?


Jaymer

nice post BobK.
well, it all goes back to what Chris said that Vlad said.
Could easily be an error in there. Hopefully Vlad will clear this up... but the proof's in the pudding.
jaymer...


aware_support

When you start CP.exe you start an Eclipse shell for the Control Panel only. The Aware IM Server is then started in a separate JVM (just like Tomcat).

So the settings you specify in CP.ini are only valid for the Eclipse shell, but not the Aware IM Server.

The server settings are indeed taken from the startupOptions.props file


BobK

The definitive answer by someone smarter then me.
That makes total sense, THANK YOU VERY MUCH.