Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » Dumping Memory when VM Heap size is not at maxmemory(Dumping Memory when VM Heap size is not at maxmemory)
Dumping Memory when VM Heap size is not at maxmemory [message #534733] Thu, 20 May 2010 08:06 Go to next message
Pamir Erdem is currently offline Pamir ErdemFriend
Messages: 4
Registered: May 2010
Location: Turkey
Junior Member
the question isi f you look at the below you can see our jvm parameters.

JVM_OPTS="-server -XX:+HeapDumpOnOutOfMemoryError -Xloggc:${CATALINA_BASE}/logs/gc.log -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:MaxPermSize=256m -Xmx1024m -Xss256k -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=114 01 -Dtexan.configuration.base="<pathToConfigurationFiles>"
CATALINA_OPTS="$JVM_OPTS $APPLICATION_OPTS"

Sometimes VM produces heap dumps when total heap memory size is not 1000M, for example at 300Mb or at 600Mb we can see hprof files which are produced by jvm (i mean which is not dumped manually.) Could you please explain how this could be happen ?

[Updated on: Thu, 20 May 2010 08:11]

Report message to a moderator

Re: Dumping Memory when VM Heap size is not at maxmemory [message #534739 is a reply to message #534733] Thu, 20 May 2010 08:24 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
An OutOfMemoryError is thrown not only when the heap is excausted. It can be thrown for example when the Perm space is full (what you defined with -XX:MaxPermSize=256m). In this case a heap dump is also written.

An OutOfMemoryError is also thrown when there is no enough native memory to create another thread (usually 32 bit systems). The message looks something like "OutOfMemoryError: unable to create new native thread"... However, I am not sure if in this case a heap dump is written.

Another possiblity - your max heap is 1G and there is let's say 600Mb used. If at this time there is an attempt to allocate an array of 600M at once, then you'll get an OutOfMemoryError and a heap dump. In the heap dump however you won't see a huge 600Mb array, as it wasn't allocated at all.

Can you get the stdout and stderr of the process? May be the OutOfMemoryError (if any) can reveal more details.
Re: Dumping Memory when VM Heap size is not at maxmemory [message #534804 is a reply to message #534733] Thu, 20 May 2010 12:00 Go to previous messageGo to next message
Pamir Erdem is currently offline Pamir ErdemFriend
Messages: 4
Registered: May 2010
Location: Turkey
Junior Member
The exception is shown in the below. The matter with this is
there is nothing can consume and free huge memory in these methods up to oracle. Because the only native part of the stack trace is the oracle driver, could it be from the this driver ? By this way from the heap dump we can not see huge chunk of arrays that consume memory.

java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid56723.hprof ...
Heap dump file created [274817860 bytes in 5.001 secs]
May 19, 2010 10:33:25 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.OutOfMemoryError: Java heap space
at oracle.jdbc.driver.T4CMAREngine.unmarshalDALC(T4CMAREngine.j ava:2480)
at oracle.jdbc.driver.T4C8TTIrxh.unmarshalV10(T4C8TTIrxh.java:1 20)
at oracle.jdbc.driver.T4C8Oall.readRXH(T4C8Oall.java:585)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:342)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:193)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableS tatement.java:205)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCa llableStatement.java:1244)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Orac leStatement.java:1585)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(O raclePreparedStatement.java:3929)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePre paredStatement.java:4118)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCal lableStatement.java:8721)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(Or aclePreparedStatementWrapper.java:4093)
at falez.runtime.sql.OracleDbmsHelper.dbmsApplicationInfoSetMod ule(OracleDbmsHelper.java:19)
at falez.runtime.sql.OracleDataSource.dbmsApplicationInfoSetMod ule(OracleDataSource.java:39)
at falez.runtime.sql.OracleDataSource.onConnectionAcquired(Orac leDataSource.java:87)
at falez.runtime.sql.OracleDataSource.getConnection(OracleDataS ource.java:45)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetCon nection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.DataSourceUtils.getConne ction(DataSourceUtils.java:79)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTempl ate.java:577)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplat e.java:641)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplat e.java:666)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplat e.java:698)
at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.ja va:112)
at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.ja va:122)
at falez.fwt.security.jdbc.AuthorizationService.loadScreenAutho rities(AuthorizationService.java:141)
at falez.fwt.security.jdbc.AuthorizationService.getScreenRoles( AuthorizationService.java:186)
at falez.fwt.server.PageRequestProcessor.process(PageRequestPro cessor.java:79)
at falez.fwt.server.PageRequestProcessor.process(PageRequestPro cessor.java:26)
at falez.fwt.server.FwtFilter.process(FwtFilter.java:166)
at falez.fwt.server.FwtFilter.doFilter(FwtFilter.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:235)
Re: Dumping Memory when VM Heap size is not at maxmemory [message #534851 is a reply to message #534804] Thu, 20 May 2010 13:42 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
Well, it says "Java heap space" so I think the only possibility that is left is that in this method there is an attempt to allocate a big chunk at once. As "unmarshall" in the method name indicates a kind of unpacking / decodin what came through the connection, my assumption can be correct.

However, I googled a bit and couldn't find any similar complains.

May be you can find out in the heap dump which was the statement that is executed and see if the problem is related to some specific statement or not.

At the moment I don't have other ideas.
Re: Dumping Memory when VM Heap size is not at maxmemory [message #534888 is a reply to message #534851] Thu, 20 May 2010 14:54 Go to previous messageGo to next message
Pamir Erdem is currently offline Pamir ErdemFriend
Messages: 4
Registered: May 2010
Location: Turkey
Junior Member
Hi,

From the heap dump and stack trace which i posted before we found out that
BEGIN DBMS_APPLICATION_INFO.SET_MODULE(:1 , :2 ); END; is the problematic package that casuse vm to dump heap. But i do not believe that this package causes heap dumps. Is it meaningfull that a package that do not return anything can cause heap dumps ?
Re: Dumping Memory when VM Heap size is not at maxmemory [message #534893 is a reply to message #534888] Thu, 20 May 2010 15:04 Go to previous messageGo to next message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
I can't tell you why this is happening. I don't know what is happening in the JDBC driver's method. From my experience with other OutOfMemory sisuations this really looks like an attempt was made to allocate a huge piece at once.

I don't know if you could try running the same with a VM which shows more details on an OutOfMemoryError. For example if you have an IBM VM and run it with verbose GC it should print something like:

...
<af type="tenured" id="1" timestamp="May 20 16:56:18 2010" intervalms="0.000">
  <minimum requested_bytes="100000016" />
...


Also the SAP VM prints how much memory needed to be allocated when the error appeared. But AFAIK it is only available with SAP products...

Can't give you any other hints. May be someone else following the forum can help.

-Krum
Re: Dumping Memory when VM Heap size is not at maxmemory [message #535021 is a reply to message #534733] Fri, 21 May 2010 06:13 Go to previous messageGo to next message
Pamir Erdem is currently offline Pamir ErdemFriend
Messages: 4
Registered: May 2010
Location: Turkey
Junior Member
One of our opinion is maybe a monitoring tool is triggering VM to dump. From the thread dumps view we can see JMX and RMI threads are open. If so how can we prove it ?

[Updated on: Fri, 21 May 2010 06:27]

Report message to a moderator

Re: Dumping Memory when VM Heap size is not at maxmemory [message #535027 is a reply to message #535021] Fri, 21 May 2010 06:53 Go to previous message
Krum Tsvetkov is currently offline Krum TsvetkovFriend
Messages: 164
Registered: July 2009
Senior Member
Well, you pasted already some logs that there is an OutOfMemoryError:
Quote:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid56723.hprof ...
Heap dump file created [274817860 bytes in 5.001 secs]

Nevertheless you may try to remove the
-XX:+HeapDumpOnOutOfMemoryError
option temporarily. If you still get dumps, then it's probably someone triggering them with a tool. But the output above deffinitely shows that the dump was written because of an OOM error.
Previous Topic:java heap size is only 20MB, but memory usage is 1.7GB
Next Topic:Error during the parser
Goto Forum:
  


Current Time: Wed Apr 24 23:58:02 GMT 2024

Powered by FUDForum. Page generated in 0.03666 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top