Opened 12 years ago

Closed 12 years ago

#1032 closed defect (fixed)

GeoNetwork freezes under Virtual Box when memory is 1GB or less

Reported by: kalxas Owned by: kalxas
Priority: major Milestone: OSGeoLive7.0
Component: OSGeoLive Keywords: 7.0
Cc: live-demo@…

Description

I have tested GN in a VM with 1G RAM and while the home page is starting up, internal geoserver never makes it, so the map remains empty and the system hangs. When I add more RAM (1,5GB) the problem is solved.

Change History (16)

comment:1 by kalxas, 12 years ago

Priority: majornormal

After more testing and some feedback from the GeoNetwork team, these are the new findings:

  1. GeoNetwork works fine when booting iso on real hardware (tested on my 1GB RAM netbook)
  2. The service starts fine under a VM with 1GB RAM but then freezes the system when Firefox tries to show the main page. This issue seems to be VM specific. Perhaps there is a memory overhead due to low quality graphics card?
  3. GeoNetwork team suggested to check the Java memory settings and define 512 MB, which was already set in the setting file.
  4. When I do "sudo service tomcat6 stop" before starting GeoNetwork's Jetty, everything works fine.

So my conclusion is that default tomcat + GN jetty on 1GB RAM bring down the system due to lack of swap space. On the other hand, other Jetty instances require less memory and work fine along with default tomcat.

Thoughts? Perhaps we should document this somewhere in the docs? I would suggest NOT to change minimum RAM requirements, it would reflect bad on OSGeoLive requesting more than 1GB RAM in my opinion, especially when our base OS requires 256MB.

comment:2 by kalxas, 12 years ago

Owner: changed from live-demo@… to kalxas
Status: newassigned
Summary: GeoNetwork freezes when memory is 1GB or lessGeoNetwork freezes under Virtual Box when memory is 1GB or less

comment:3 by darkblueb, 12 years ago

A quick test of an installed VM shows.. after boot, the two largest RESIDENT memory users are tomcat6 and mysqld. As noted, sudo service tomcat6 stop frees a significant amount of RAM.

Does tomcat6 really need to be running all the time? What is a good way to politely turn tomcat6 off, with a Live session and/or an installed VM ?

comment:4 by darkblueb, 12 years ago

booting an image (r9520) without installing, shows the top three resident RAM users

 34M - X.org
 34M - mysqld
117M - tomcat6 (!!)

comment:5 by kalxas, 12 years ago

A possible solution would be to move 52North, petascope and deegree to their own Jetty instances and disable Tomcat. Another solution is to detect if tomcat is running when launching a project that is using it and start the service then. This would let us disable the service by default.

#!/bin/bash
STAT=`netstat -na | grep 8080 | awk '{print $7}'`
if [ "$STAT" = "LISTEN" ]; then
echo "Tomcat is up"
elif [ "$STAT" = "" ]; then 
echo "8080 is not used so Tomcat is down"
sh /usr/share/tomcat6/startup.sh
fi

comment:6 by kalxas, 12 years ago

Keywords: alpha 4 removed

comment:7 by kalxas, 12 years ago

Keywords: 7.0 added; 6.5 removed
Milestone: OSGeoLive6.5OSGeoLive7.0

Temporary fixed [9593]

comment:8 by hamish, 12 years ago

Cc: live-demo@… added

please move the ML email addr from the owner field if you take ownership of a ticket so it doesn't get lost

in reply to:  8 ; comment:9 by kalxas, 12 years ago

Replying to hamish:

please move the ML email addr from the owner field if you take ownership of a ticket so it doesn't get lost

Hamish, only an admin can do this.

comment:10 by kalxas, 12 years ago

I just disabled tomcat autostart [10133] We now need to update tomcat based projects

in reply to:  9 ; comment:11 by hamish, 12 years ago

Replying to kalxas:

Replying to hamish:

please move the ML email addr from the owner field if you take ownership of a ticket so it doesn't get lost

Hamish, only an admin can do this.

at the time I first wrote the above it was true, but since then I changed the trac permission settings and AFAIK for the last few months logged in users can now modify the cc field too.

regards, Hamish

in reply to:  11 comment:12 by kalxas, 12 years ago

Replying to hamish:

Replying to kalxas:

Replying to hamish:

please move the ML email addr from the owner field if you take ownership of a ticket so it doesn't get lost

Hamish, only an admin can do this.

at the time I first wrote the above it was true, but since then I changed the trac permission settings and AFAIK for the last few months logged in users can now modify the cc field too.

regards, Hamish

Cool, thanks Hamish.

comment:13 by kalxas, 12 years ago

Priority: normalmajor

Disabling tomcat in VM works, but not for live session.

comment:14 by kalxas, 12 years ago

After recent IRC chat, we committed the proposed fix in http://www.kromhouts.net/blog/server-admin/prevent-tomcat-starting-at-boot/

comment:15 by kalxas, 12 years ago

We need to come up with a plan for Java applications deployment:

  1. Default tomcat should be disabled on boot. This will save valuable RAM on boot and make the disk boot faster. Applications deployed on tomcat should take actions to enable tomcat on their startup scripts.
  2. GeoServer is a key Java application in the disk. Many other projects (Geonetwork, zoo, 52N, Cartaro, GeoNode etc) depend on it being activated. My proposal is to move GeoServer to the default tomcat so it gets enabled easily. This way we remove one Jetty deployement and save on disk space too.

Thoughts?

comment:16 by kalxas, 12 years ago

Resolution: fixed
Status: assignedclosed

Default tomcat has been removed from autostart in [10180] With this fix the bug is now fixed and tested on build 10181.

Note: See TracTickets for help on using tickets.