Page 1 of 5 12345 LastLast
Results 1 to 20 of 88
  1.    #1  
    DO NOT FOLLOW THESE INSTRUCTIONS UNLESS YOU ARE CONFIDENT YOU CAN BACK UP YOUR FILES AND UNDERSTAND A PATCH DONE BACKWARDS AND MANUALLY APPLY. IF YOU BREAK THIS FILE, YOUR PRE WILL NOT BOOT. PLEASE HAVE FUN RESTORING YOUR PALM YOURSELF.

    Root cause: Java is running out of heap. I believe there may also be stack space issues, but that's for later testing.

    Fix: Mod /usr/bin/java-serviceboot to change . Those experienced will not need to be told to mount rw, edit by hand, etc. Reversed diff:

    palm-webos-device bin # diff java-serviceboot java-serviceboot.orig.palm
    --- java-serviceboot Thu Apr 15 23:39:15 2010
    +++ java-serviceboot.orig.palm Thu Apr 15 23:38:39 2010
    @@ -23,8 +23,8 @@
    CLASSPATH=$(GetClasspath)

    TZID=`date +%Z`
    -JAVAMEM="${JAVAMEM:-15M}"
    -JAVAMEMMAX="${JAVAMEMMAX:-30M}"
    +JAVAMEM="${JAVAMEM:-10M}"
    +JAVAMEMMAX="${JAVAMEMMAX:-15M}"

    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -classpath $CLASSPATH -DtimeZoneId=$TZID \
    -Djava.util.logging.config.file=/etc/logging.properties \
    palm-webos-device bin #

    Proof: I was able to run Glyder 2, a weather app, a timer app, and preware alpha doing an update simultaneously.

    I would be interested to know of anyone else's experience.

    Cheers, Steve
  2. #2  
    dude, no idea how to make that work... but good call
  3. Minsc's Avatar
    Posts
    967 Posts
    Global Posts
    974 Global Posts
    #3  
    So what exactly is Java's role in webos? What is its relationship with the Luna application stack? Obviously it must be integral if your theory is true.

    I've been of the opinion lately that the real cause of TMC is simply that physical memory is exhausted. (by looking at top in linux) But that's not exactly scientific.
  4. rkguy's Avatar
    Posts
    803 Posts
    Global Posts
    816 Global Posts
    #4  
    Could you say something about the pros and cons of Palm not making the changes to clear the java heap
  5. #5  
    Brilliant! I just made the modification and it seems to be working so far, exactly as you reported.

    By analyzing top it now appears that Java is ensuring to always leave about 30MB free (as specified) instead of hogging more than that, thus allowing other applications to run.
    Last edited by webfellow; 04/15/2010 at 10:26 PM. Reason: .
  6.    #6  
    Quote Originally Posted by Rkguy View Post
    Could you say something about the pros and cons of Palm not making the changes to clear the java heap
    Sorry, no, I don't work for Palm. I have no access to their design documents so I do not know the specifics of the garbage collection routine.

    Cheers, Steve
  7.    #7  
    Quote Originally Posted by webfellow View Post
    Brilliant! I just made the modification and it seems to be working so far, exactly as you reported.

    By analyzing top it now appears that Java is ensuring to always leave about 30MB free (as specified) instead of hogging more than that, thus allowing other applications to run.
    Roughly, yeah. Few more mods I found with some more digging that may or may not make a difference:

    JAVAMEM="${JAVAMEM:-15M}"
    JAVAMEMMAX="${JAVAMEMMAX:-30M}"
    JAVAEDEN="2M"
    JAVASTACK="2M"

    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xmn$JAVAEDEN -Xss$JAVASTACK -classpath $CLASSPATH -DtimeZoneId=$TZID \

    Thanks for the feedback.

    Cheers, Steve
  8. rkguy's Avatar
    Posts
    803 Posts
    Global Posts
    816 Global Posts
    #8  
    Quote Originally Posted by sbromwich View Post
    Sorry, no, I don't work for Palm. I have no access to their design documents so I do not know the specifics of the garbage collection routine.

    Cheers, Steve
    How about .... Does your mod actually have any tradeoffs?

    If it's all gravy then I don't understand why Palm engineers didn't do it.
  9.    #9  
    Stripping things down even further:

    TZID=`date +%Z`
    JAVAMEM="${JAVAMEM:-15M}"
    JAVAMEMMAX="${JAVAMEMMAX:-30M}"

    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xgcagressive -classpath $CLASSPATH -DtimeZoneId=$TZID"

    JAVAARGS=""
    MAINCLASS="com.palm.serviceboot.ServiceBoot"

    Cheers, Steve
  10.    #10  
    Quote Originally Posted by Minsc View Post
    So what exactly is Java's role in webos? What is its relationship with the Luna application stack? Obviously it must be integral if your theory is true.

    I've been of the opinion lately that the real cause of TMC is simply that physical memory is exhausted. (by looking at top in linux) But that's not exactly scientific.
    I believe it runs various services, particularly background ones such as synergy, IPC, and mail handling. ps auxww | grep -i java | tr : '\n' | less will show you the jars it loads in a relatively legible format.

    Cheers, Steve
  11. #11  
    Quote Originally Posted by Minsc View Post
    So what exactly is Java's role in webos? What is its relationship with the Luna application stack? Obviously it must be integral if your theory is true.
    A lot of their internal services are written in java.

    Like email, gps, etc, though i really don't know which ones. Or if those two are even in java.
  12.    #12  
    Webfellow made a nice discovery, disabling logging to improve performance by reducing disk writes can be done with the following (again, reversed) patch:

    palm-webos-device /etc # diff logging.properties logging.properties.orig.palm
    --- logging.properties Fri Apr 16 01:06:28 2010
    +++ logging.properties.orig.palm Fri Apr 16 01:05:48 2010
    @@ -27,12 +27,12 @@
    #com.palm.MYSERVICENAME.bufferSize = 5

    # default FileHandler output is in a logs directory under Staging
    -#java.util.logging.FileHandler.pattern = /var/log/java-%g.log
    -#java.util.logging.FileHandler.limit = 50000
    -#java.util.logging.FileHandler.count = 2
    -#java.util.logging.FileHandler.append = true
    +java.util.logging.FileHandler.pattern = /var/log/java-%g.log
    +java.util.logging.FileHandler.limit = 50000
    +java.util.logging.FileHandler.count = 2
    +java.util.logging.FileHandler.append = true
    #java.util.logging.FileHandler.formatter = com.palm.oasis.util.OasisLoggingFormatter
    -#java.util.logging.FileHandler.formatter = com.palm.oasis.util.JavaFileFormatter
    +java.util.logging.FileHandler.formatter = com.palm.oasis.util.JavaFileFormatter

    # Uncomment if you want to see ServiceLogger output in java-serviceboot's
    # console (in addition to /var/log/messages)
    @@ -48,10 +48,10 @@
    # com.palm.oasis.util.OasisLoggingFormatter.format = SHORT

    # Configure PerfLogger so that any perf-specific into is set to 'perfdata.txt'
    -#com.palm.oasis.util.PerfLogger.handlers = com.palm.oasis.util.PerfFileHandler
    -#com.palm.oasis.util.PerfLogger.level = FINEST
    +com.palm.oasis.util.PerfLogger.handlers = com.palm.oasis.util.PerfFileHandler
    +com.palm.oasis.util.PerfLogger.level = FINEST
    #com.palm.oasis.util.PerfLogger.useParentHandlers = false
    -#com.palm.oasis.util.PerfFileHandler.filename = perfdata.txt
    +com.palm.oasis.util.PerfFileHandler.filename = perfdata.txt

    # Service-specific logging
    com.palm.mail.level = WARNING
    palm-webos-device /etc #

    Cheers, Steve
  13.    #13  
    Quote Originally Posted by Rkguy View Post
    How about .... Does your mod actually have any tradeoffs?

    If it's all gravy then I don't understand why Palm engineers didn't do it.
    Yes; it's setting the max memory for java can use to something higher. This will be stolen (mostly) from cache, so it may have a negative impact on disk read performance.

    Cheers, Steve
  14. #14  
    Quote Originally Posted by sbromwich View Post
    Stripping things down even further:

    TZID=`date +%Z`
    JAVAMEM="${JAVAMEM:-15M}"
    JAVAMEMMAX="${JAVAMEMMAX:-30M}"

    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xgcagressive -classpath $CLASSPATH -DtimeZoneId=$TZID"

    JAVAARGS=""
    MAINCLASS="com.palm.serviceboot.ServiceBoot"

    Cheers, Steve


    Quote Originally Posted by sbromwich View Post
    Roughly, yeah. Few more mods I found with some more digging that may or may not make a difference:

    JAVAMEM="${JAVAMEM:-15M}"
    JAVAMEMMAX="${JAVAMEMMAX:-30M}"
    JAVAEDEN="2M"
    JAVASTACK="2M"

    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xmn$JAVAEDEN -Xss$JAVASTACK -classpath $CLASSPATH -DtimeZoneId=$TZID \


    Cheers, Steve

    So should we apply all and make the line say
    Code:
    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xmn$JAVAEDEN -Xgcagressive -classpath $CLASSPATH -DtimeZoneId=$TZID \
    or just make one change?
    Last edited by mamouton; 04/15/2010 at 11:22 PM.
  15. #15  
    DO NOT apply the patch with -Xmn or -Xss ... and if you'd better be sure to know how to fix your phone if it breaks, because it might.

    Quite seriously, any of these changes WILL CAUSE your phone to lose network AND phone connectivity. He warned you.

    Thanks sbromwich for posting the last reversed diff, I can also confirm things still work as advertised.
    Last edited by webfellow; 04/15/2010 at 11:17 PM. Reason: .
  16. mark2jas's Avatar
    Posts
    76 Posts
    Global Posts
    77 Global Posts
    #16  
    wait...wait... Can you guys tell us where to start please??? Tnx.
  17.    #17  
    Quote Originally Posted by mamouton View Post
    So should we apply all and make the line say
    Code:
    VMARGS="-Xms$JAVAMEM -Xmx$JAVAMEMMAX -Xmn$JAVAEDEN -Xgcagressive -classpath $CLASSPATH -DtimeZoneId=$TZID \
    or just follow or just make one change?
    Post #10 is the one to follow. Disabling logging helps as well. In my testing (which I admit is limited and may be psychosomatic) the following seemed appreciably faster:

    * weather channel app
    * camera
    * photo browsing
    * web browsing

    Did not seem faster:

    * preware alpha (unsurprising, C server not java)
    * facebook app

    Cheers, Steve
  18. #18  
    Quote Originally Posted by sbromwich View Post
    Webfellow made a nice discovery, disabling logging to improve performance by reducing disk writes can be done with the following (again, reversed) patch:

    palm-webos-device /etc # diff logging.properties logging.properties.orig.palm
    --- logging.properties Fri Apr 16 01:06:28 2010
    +++ logging.properties.orig.palm Fri Apr 16 01:05:48 2010
    @@ -27,12 +27,12 @@
    #com.palm.MYSERVICENAME.bufferSize = 5

    # default FileHandler output is in a logs directory under Staging
    -#java.util.logging.FileHandler.pattern = /var/log/java-%g.log
    -#java.util.logging.FileHandler.limit = 50000
    -#java.util.logging.FileHandler.count = 2
    -#java.util.logging.FileHandler.append = true
    +java.util.logging.FileHandler.pattern = /var/log/java-%g.log
    +java.util.logging.FileHandler.limit = 50000
    +java.util.logging.FileHandler.count = 2
    +java.util.logging.FileHandler.append = true
    #java.util.logging.FileHandler.formatter = com.palm.oasis.util.OasisLoggingFormatter
    -#java.util.logging.FileHandler.formatter = com.palm.oasis.util.JavaFileFormatter
    +java.util.logging.FileHandler.formatter = com.palm.oasis.util.JavaFileFormatter

    # Uncomment if you want to see ServiceLogger output in java-serviceboot's
    # console (in addition to /var/log/messages)
    @@ -48,10 +48,10 @@
    # com.palm.oasis.util.OasisLoggingFormatter.format = SHORT

    # Configure PerfLogger so that any perf-specific into is set to 'perfdata.txt'
    -#com.palm.oasis.util.PerfLogger.handlers = com.palm.oasis.util.PerfFileHandler
    -#com.palm.oasis.util.PerfLogger.level = FINEST
    +com.palm.oasis.util.PerfLogger.handlers = com.palm.oasis.util.PerfFileHandler
    +com.palm.oasis.util.PerfLogger.level = FINEST
    #com.palm.oasis.util.PerfLogger.useParentHandlers = false
    -#com.palm.oasis.util.PerfFileHandler.filename = perfdata.txt
    +com.palm.oasis.util.PerfFileHandler.filename = perfdata.txt

    # Service-specific logging
    com.palm.mail.level = WARNING
    palm-webos-device /etc #

    Cheers, Steve
    Crazy question but with the logging disabled what can we expect to lose as far as functionality?
  19.    #19  
    Quote Originally Posted by mark2jas View Post
    wait...wait... Can you guys tell us where to start please??? Tnx.
    Sure. Start by installing Linux on your host PC and getting the hang of vi. Then you need to figure out mounting and unmounting. Next, install diff and try diff against a few text files of your own to see what I mean by a reverse patch. Finally, delete your kernel and figure out how to rescue your system.

    Once you've done that, this should be a piece of cake.

    Cheers, Steve
  20.    #20  
    Quote Originally Posted by mamouton View Post
    Crazy question but with the logging disabled what can we expect to lose as far as functionality?
    If you're doing java development, you lose access to the java console, and you won't be able to trace your logs for your application. I do not believe (although I would accept being proved wrong) that the typical user will see any difference from a functionality perspective.

    Cheers, Steve
Page 1 of 5 12345 LastLast

Posting Permissions