Invalid maximum heap size

7,713 views
Skip to first unread message

oscarvarto

unread,
Mar 5, 2012, 3:45:35 PM3/5/12
to Akka User List
I can't "install" akka properly. Once I download Akka 2.0-RC4, I try
to run the sample microkernel application included in this download:


$ bin/akka sample.kernel.hello.HelloKernel

Invalid maximum heap size: -Xmx1024M -Xms1024M -Xss1M -
XX:MaxPermSize=256M -XX:+UseParallelGC -XX:OnOutOfMemoryError="kill -9
%p"
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Help!

√iktor Ҡlang

unread,
Mar 5, 2012, 3:51:57 PM3/5/12
to akka...@googlegroups.com
Hi Oscar,

unfortunately you have given us 0 information to work with, like which OS, which jvm version etc.
have you've tried to google the error message? 

Cheers,



--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

oscarvarto

unread,
Mar 5, 2012, 4:00:14 PM3/5/12
to Akka User List
Thanks for the quick reply. Yes I've used google to solve this issue
by myself, and I haven't found anything useful.

I'm working on Arch Linux x86_64
$ uname -a
Linux compu4 3.2.8-1-ARCH #1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012
x86_64 AMD Phenom(tm) II X6 1055T Processor AuthenticAMD GNU/Linux
$ java -version
Picked up _JAVA_OPTIONS: -
Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)


I tried to use an environment variable:
export JVM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"

it didn't work.
> Typesafe <http://www.typesafe.com/> - The software stack for applications
> that scale
>
> Twitter: @viktorklang

Brian Smith

unread,
Mar 5, 2012, 4:27:11 PM3/5/12
to akka...@googlegroups.com
Hi

Invalid maximum heap size indicates there's something wrong with your -Xmx argument.  

I think your use of double quotes is confusing the JVM and it thinks -XX:MaxPermSize=256M is also part of the argument to -Xmx.

Try setting the environment variable to a value that doesn't contain double quotes.

e.g.  export JVM_ARGS='-Xmx1024M -XX:MaxPermSize=256M'

Cheers

Brian

oscarvarto

unread,
Mar 5, 2012, 4:51:11 PM3/5/12
to Akka User List
A friend help me.

$ bin/akka sample.kernel.hello.HelloKernel
worked changing bin/akka according to the same file in version 1.3.1:

I removed this
-XX:OnOutOfMemoryError=\"kill -9 %p\

and the "" in
"$JAVA_OPTS"

------------------------------------------
$ cat akka-microkernel-1.3.1/bin/akka
#!/bin/bash
AKKA_HOME="$(cd "$(cd "$(dirname "$0")"; pwd -P)"/..; pwd)"
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xms1536M -Xmx1536M -Xss1M -
XX:MaxPermSize=256M -XX:+UseParallelGC"
[ -n "$AKKA_CLASSPATH" ] || AKKA_CLASSPATH="$AKKA_HOME/lib/scala-
library.jar:$AKKA_HOME/lib/akka/*:$AKKA_HOME/config"
java $JAVA_OPTS -cp "$AKKA_CLASSPATH" -Dakka.home="$AKKA_HOME"
akka.kernel.Main

-------------------------------------------
$ cat akka-2.0-RC4/bin/akka
#!/usr/bin/env bash

declare quiet="false"

while true; do
case "$1" in
-q | --quiet ) quiet="true"; shift ;;
* ) break ;;
esac
done

[[ "$@" ]] || {
echo "No boot classes specified"
echo "Usage: bin/akka org.somewhere.BootClass"
exit 1
}

declare AKKA_HOME="$(cd "$(cd "$(dirname "$0")"; pwd -P)"/..; pwd)"

[ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xmx1024M -Xms1024M -Xss1M -
XX:MaxPermSize=256M -XX:+UseParallelGC -XX:OnOutOfMemoryError=\"kill
-9 %p\""

[ -n "$AKKA_CLASSPATH" ] || AKKA_CLASSPATH="$AKKA_HOME/lib/scala-
library.jar:$AKKA_HOME/config:$AKKA_HOME/lib/akka/*"

java "$JAVA_OPTS" -cp "$AKKA_CLASSPATH" -Dakka.home="$AKKA_HOME" -
Dakka.kernel.quiet=$quiet akka.kernel.Main "$@"

----------------------------
Reply all
Reply to author
Forward
0 new messages