Forums Register Login

java.lang.OutOfMemoryError: Java heap space

+Pie Number of slices to send: Send
Hi friends

I am getting java.lang.OutOfMemoryError: Java heap space error.I read the thread

https://coderanch.com/t/87530/Tomcat/Out-memory-Tomcat
I can come to any conclution.with the help of line



at the begining of the program i got
Java memory in use = 10939448

at the end of program i got
Java memory in use = 44747512

-Xms512m -Xmx512m ble bla ......

Please help me to sort out my problem

thanks in advance
+Pie Number of slices to send: Send
There are only two ways of dealing with the OutOfMemoryException:

  • Reduce program memory consumption. The heap usage can be analysed using tools like jhat.
  • Increase memory allocated to the JVM using the -Xms and -Xmx JVM options.


  • You need to decide, what is it that you want to do. Show us some efforts, give enough information and we will be happy to help.
    +Pie Number of slices to send: Send
    You need to track what the garbage collector is doing. See my paper at ceCMG for one way you could do this. (And no, using JConsole does not provide the necessary information - you need to know how much heap space is in use after each major collection.)
    +Pie Number of slices to send: Send
    Oh, the other option is to read the performance chapter of JBoss In Action where I go into this in detail. Most of the chapter applies to Java apps in general, not just to JBossAS.
    +Pie Number of slices to send: Send
    Hi

    answer to my post helped me a lot..my problem solved.many string buffer caused main problem and some more too..

    thanks for tutorials

    +Pie Number of slices to send: Send
     

    priya pratheepp wrote:Hi

    answer to my post helped me a lot..my problem solved.many string buffer caused main problem and some more too..

    thanks for tutorials




    hi priya i recently got this error and i dont know how to solve this case and ive been increasing my memory on my run.conf



    but im still getting this error?

    how could i fix this? i have many setter and getter method does this method affect consuming the memory or causing java heap space?

    thanks
    +Pie Number of slices to send: Send
    Do heap dump analysis.
    Watchya got in that poodle gun? Anything for me? Or this tiny ad?
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 7121 times.
    Similar Threads
    JAVA HEAP SIZE and files to byte[]-Array
    Memory heap error
    java.lang.OutOfMemoryError: Java heap space
    Out of memory error
    Avoiding Heap Space Memory Problem
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 28, 2024 02:06:23.