JVM execution options on the EV3?

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

JVM execution options on the EV3?

Postby AlanG » Mon Jul 07, 2014 4:36 pm

When I use the leJOS "Programs" menu to manually start a program on the EV3, I want the JVM to run that program with the -Xincgc option. Is there an options file on the SD card in which I should insert -Xincgc and any other execution options that I may want?
AlanG
New User
 
Posts: 15
Joined: Wed May 21, 2014 10:02 pm

Re: JVM execution options on the EV3?

Postby gloomyandy » Mon Jul 07, 2014 7:30 pm

You can edit the jrun file, I think that is used by the menu system. Out of interest why do you want to change the gc settings? If you are seeing pauses these may be due to the jit rather than the gc.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: JVM execution options on the EV3?

Postby AlanG » Mon Jul 07, 2014 10:12 pm

As I read about the particular Java 7 Embedded JRE that you use for Linux and the ARM 9, I got the impression that JIT and HotSpot functions were not part of that particular JRE. Is that not correct?

I have seen some unexpected execution pauses in one of my programs. And over many years of Java programming I have gotten used to using -Xincgc routinely, to get good real-time performance from multiple simultaneous threads.
AlanG
New User
 
Posts: 15
Joined: Wed May 21, 2014 10:02 pm

Re: JVM execution options on the EV3?

Postby gloomyandy » Mon Jul 07, 2014 10:36 pm

The VM we use is hotspot based and includes a jit. What makes you think this is not the case?

You may find it easier to test things to simply login to the EV3 using ssh and run your programs manually, then you can pass any commands you require. You may need to kill the menu process to stop this from interfering with your program. What sort of pauses are you seeing, what problems are you trying to solve? Remember that the EV3 is not that powerful a system and obtaining hard real time may not be possible in Java. We switched the motor control code from Java to native code, to avoid issues with jit pauses.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: JVM execution options on the EV3?

Postby AlanG » Tue Jul 08, 2014 12:14 am

I elected to download and install "ejre-7u60-fcs-b19-linux-arm-sflt-headless-07_may_2014.tar.gz" because it is designed for the ARMv5 architecture, which is the architecture used to build the EV3's Texas Instruments ARM9 core. Looking at Oracle's naming convention for ARM downloads, I guess I assumed that this was a "client compiler" JRE, even though neither "client compiler" nor "server compiler" is included in that name.

So is the ARMv5 JRE really a "server compiler" with JIT capability, and I don't have to explicitly invoke -Xincgc?

If it isn't, then is /home/root/lejos/bin/jrun the file which needs to be edited?
It looks like the last line in the file should change from:
exec ${LEJOS_HOME}/ejre*/bin/java -classpath $classpath $*
to:
exec ${LEJOS_HOME}/ejre*/bin/java -Xincgc -classpath $classpath $*
AlanG
New User
 
Posts: 15
Joined: Wed May 21, 2014 10:02 pm

Re: JVM execution options on the EV3?

Postby gloomyandy » Tue Jul 08, 2014 2:06 am

The client VM has a jit, as well as the server version.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: JVM execution options on the EV3?

Postby skoehler » Tue Jul 08, 2014 12:11 pm

Traditionally, Oracle has shipped the JRE with client and server HotSpot JVMs. (amd64 builds only the included the server JVM for some reason.) Both have a JIT. The only difference that I'm aware of, is that the server JVM would try to optimize code harder than the client JVM. Here you can read more about it:
http://en.wikipedia.org/wiki/HotSpot#Features
skoehler
leJOS Team Member
 
Posts: 1418
Joined: Thu Oct 30, 2008 4:54 pm

Re: JVM execution options on the EV3?

Postby ryangardner » Sat Jul 19, 2014 12:43 am

Before turning on incgc you could try turning in verbose GC and see if the pauses are actually GC related.
ryangardner
New User
 
Posts: 6
Joined: Sat Jun 21, 2014 12:41 pm


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff