No announcement yet.

Out of Memory - LINUX

  • Time
  • Show
Clear All
new posts

  • Out of Memory - LINUX

    Hi all,
    I was hoping one of the Linux gurus could clarify something for me..

    Sometime starting over the weekend, some OTM actions.. such as change password and enter shipment events started throwing an out of memory error.
    (specific error below)

    OTM was ok otherwise and the memory issue seemed to occur only doing the above.

    OAS and Tomcat console.log did not show the error (or any errors) and the memory usage on each, before GC, was low.

    Before GC was around 500 MB on both.

    The out of memory only showed in and on the UI screen.

    Web and APP (OAS) are on their own servers.
    APP/OAS is a 4x2 CPU with 8 GB ram.

    During the issue yesterday, TOP showed: (APP)

    Tasks: 180 total, 1 running, 179 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.5% us, 0.2% sy, 0.0% ni, 99.2% id, 0.2% wa, 0.0% hi, 0.0% si
    Mem: 8309152k total, 8281672k used, 27480k free, 227524k buffers
    Swap: 9727348k total, 0k used, 9727348k free, 6392856k cached

    CURRENT top on APP - no issues today:

    Tasks: 174 total, 1 running, 173 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.5% us, 0.4% sy, 0.0% ni, 98.9% id, 0.2% wa, 0.0% hi, 0.0% si
    Mem: 8309152k total, 2556968k used, 5752184k free, 165652k buffers
    Swap: 9727348k total, 0k used, 9727348k free, 1266168k cached

    free showed a huge cached memory amount, which accounted for the very low free memory.

    There was zero swapping.
    OAS was using 1.1 GB and nothing else appeared to be using much memory.

    My understanding is that cached memory is normal and LINUX will re-use any of the needed cached pages.
    I just have never seen an extra 4 GB of cached pages before.

    We normally see TOP showing as above in the 'CURRENT' snapshot.

    This is a hosted server (IBM).
    There are other things on the box, such as Tivoli running.

    We asked IBM engineers to look at the box to see if they noticed something we didn't.
    We received a very vague response from IBM saying the cached memory was used up and the physical server had to be restarted.
    They were given the green light before anyone was consulted.. and the physical server was restarted.

    The out of memory and high cached memory issue did not come back, and that was the only time we have seen both occur.

    Question: Is this normal for LINUX to cache so much physical memory ?

    Does anyone have any thoughts on the specific out of memory error ?

    Any comments in general on this issue ?

    Thanks a lot !

    2008-04-21 10:14:55.730 0 Error Exception java.lang.OutOfMemoryError
    at Method)
    at java.util.jar.JarFile.(
    at java.util.jar.JarFile.(
    at oracle.classloader.SharedJar.doOpen( :20
    at oracle.classloader.SharedCodeSource.ensureOpen(Sha
    at oracle.classloader.SharedCodeSource.getResourceByt es(
    at oracle.classloader.CodeSourceSearchPolicy.findReso urceBytes(
    at oracle.classloader.PolicyClassLoader.findLocalClas s(
    at oracle.classloader.SearchPolicy$FindLocal.getClass (
    at oracle.classloader.SearchSequence.getClass(SearchS
    at oracle.classloader.PolicyClassLoader.internalLoadC lass(
    at oracle.classloader.PolicyClassLoader.loadClass(Pol
    at oracle.classloader.PolicyClassLoader.loadClass(Pol
    at java.lang.ClassLoader.loadClassInternal(ClassLoade
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at oracle.jdbc.ttc7.TTC7Protocol.safelyGetClassForNam e(
    at oracle.jdbc.driver.OracleConnection.safelyGetClass ForName(
    at oracle.jdbc.driver.OracleConnection.addClassMapEnt ry(
    at oracle.jdbc.driver.OracleConnection.addDefaultClas sMapEntriesTo(
    at oracle.jdbc.driver.OracleConnection.initializeClas sMap(
    at oracle.jdbc.driver.OracleConnection.ensureClassMap Exists(
    at oracle.jdbc.driver.OracleConnection.getTypeMap(Ora
    at glog.util.jdbc.noserver.T2SharedConnection.setType MapUser(
    at glog.util.jdbc.noserver.T2SharedConnection.setCach edUser(
    at glog.util.jdbc.noserver.T2SharedConnection.setCach edUser(
    at glog.util.jdbc.noserver.T2SharedConnection.setCach edUser(
    at glog.util.jdbc.noserver.T2SharedConnection.setUser (
    at glog.util.datasource.ConnectionEstablisher.setVpdU ser(
    at glog.util.datasource.GC3ConnectionEstablisher.conn ect(
    at glog.util.datasource.GC3ConnectionPoolInstance.con nect(
    at glog.util.datasource.GC3ConnectionPoolInstance.res erveConnections( )
    at glog.util.datasource.GC3ConnectionPoolInstance.can ReserveConnection( 84)
    at glog.util.datasource.GC3ConnectionPoolInstance.res erve(
    at glog.util.datasource.GC3ConnectionPool.reserve(GC3
    at glog.util.datasource.DataSource.reserve(DataSource .java:143)
    at glog.util.datasource.DataSource.reserve(DataSource .java:137)
    at glog.util.jdbc.noserver.T2SharedConnection$Referen cedConnection.addRef(
    at glog.server.eventgroup.EventGroup.loadEventGroups(
    at glog.server.eventgroup.EventGroup.get(EventGroup.j ava:17)
    at glog.server.eventgroup.EventGroupClassification.lo ad(
    at tClassification(
    at assify(
    at sifySsEventGroups( 6)
    at glog.server.executionapi.servprov.shipmentstatus.S hipmentStatusSessionBean.addSSHistoryAndPublish(Sh
    at glog.server.executionapi.servprov.shipmentstatus.S hipmentStatusSessionBean.addShipmentStatusInternal (
    at glog.server.executionapi.servprov.shipmentstatus.S hipmentStatusSessionBean.addShipmentStatus(Shipmen
    at glog.server.executionapi.servprov.shipmentstatus.S hipmentStatusSessionServerSideEJBWrapper.addShipme ntStatus(ShipmentStatusSessionServerSideEJBWrapper .java:220)

  • #2
    Re: Out of Memory - LINUX


    I'm not sure that I agree with the IBM tech. You're right that Linux (and most modern OS's) will utilize any free memory in order to cache filesystem activity. In fact, I've seen this as high as 12GB on a 16GB server. The point is, as soon as this memory is needed for another process, the OS will immediate release it. So if you're looking at memory utilization graphs, it's important to exclude the system cache, in order to get a true view.

    Now - based on the error, it seems that someone tried to load up a large zip file into OTM (see below - highlighted). The out of memory issue is likely code related, rather than JVM heap memory, which is why the error showed up in the and not the console.log file. So - some component of OTM was trying to unzip this file and was unable to deal with the expanded size.

    2008-04-21 10:14:55.730 0 Error Exception java.lang.OutOfMemoryError
    at Method)

    I believe there is a limit in how large uploaded files can be in OTM, but don't remember the exact limit (5, 10 or 20MB - something like that). There is another servlet that allows larger uploads, but it doesn't kick of Agents and other workflow actions.

    I would find out who was doing the upload and then try it again with a smaller file.

    Chris Plough


    • #3
      Re: Out of Memory - LINUX

      Hey Chris,
      Thanks for the reply and confirming my understanding of the file system cache.

      I also don't think the IBM tech knew what he was talking about.. and I haven't been shy about expressing my opinion for the past 2 days..

      My first thought was an upload also, but we were able to reproduce the error just trying to add a shipment event as well as a new user trying to change their password on their first login attempt.

      The issue has only occurred 1 time, so perhaps there was a fluke or such..

      Thanks for the input !