Learn about Java memory spaces?

Hi, I'm a student, and I need to do some research on and write a small paper about the "three or more Java memory spaces", what they do, how they differ.
The only problem is that spending a half hour searching google and reading quite a bit of documentation, I can't find any significant reference to or classification of these memory spaces! Can anyone provide me with a link to documentation that describes these memory spaces and their uses?
Thanks for your help!

Also
http://java.sun.com/products/hotspot/docs/whitepaper/Java_HotSpot_WP_Final_4_30_01.html
http://java.sun.com/developer/technicalArticles/Programming/turbo/ and the documents referenced at the end of the article
http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
Thes will lead you to additional documentation.

Similar Messages

  • How do you begin learning about Java?

    Hi. I'm new to Java. I began taking a class at the local Community college where I live. I'm in my second term. It's a lot harder than the first. I'm not sure if I still understand the basics. I've written in COBOL, RPG I,II,III&IV, C, C++, C#, Pascal, Fortran, and Basic...along with a few other languages, but I find Java the hardest one to understand and program in.
    Anyone out there got any advise as to how to begin?
    I still feel very lost.

    I am still learning myself. I have dabbled in programming since about 1976 when BASIC was available on the TRS-80 Model 1 but never did anything serious.
    Start with the Java Tutorials at http://java.sun.com/docs/books/tutorial then look at other tutorials. There are some here:
    <ul><li>Java Beginner Tutorial by
         Srini Appikatla</li>
    <ul><li>[http://www.javabeginner.com/]</li>
    </ul>
    </ul>
    <ul><li>Java Advanced Tutorials on
         ipodlot.com</li>
    <ul><li>[http://www.ipodlot.com/javalearner/test/advanced.htm]</li>
    </ul>
    </ul>
    I haven't worked through all of them but they look good so far.
    Next, buy some books. I like "The Java Tutorial" Forth Edition. Yes, it is the same as the web site but it is easy to read sequencially. It doesn't cost much, used on Amazon.
    Finally, actually write some code. It doesn't have to do much. Just play around. As you learn each new thing, try it out. It makes a big difference.

  • Learning about Java Beans. Help!.

    Hello all.
    I want to learn to create and use JavaBeans, but not by where to begin.
    Somebody can explain to me that it is a Java Bean and as is used.
    Knows some site where it can see examples or it has a tutorial on Beans.
    Thank you very much.

    Hi
    I've just started learning Java too on my own. What I know about JavaBeans for the moment is that a JavaBean is a visual component you can create and give methods(setters and getters).
    For example: JPanel, JLabel, JTextField, these are examples of JavaBeans, but you can also create them by yourself.
    I use JBuilder 5 Enterprise from Borland. You can download JBuilder 6, trial version I belief from www.borland.com. I'm not certain.
    How do I create JavaBeans in JBuilder?
    First you have to create a new Project. Then you can go to the menu File/New and you choose to create a JavaBean. Then JBuilder asks for some information, which package, name, base class...
    I've made a JavaBean, xJTextField. With each JTextField, ussually you also have a JLabel, so I've created a JavaBean xJTextField based on a JPanel. In that panel I've placed two components, a JTextField and a JLabel. I've added some methods and that's it. Now I can place an instance of xJTextField on every frame and automatically I have a JLabel and JTextField.
    I have just begon too with Java, I hope I helped you a bit. If you would like it, I can send you my project with my JavaBean and some explanation.
    Do you know some interesting websites about J2EE?
    Rik

  • What is the best way to learn about java?

    What is the best and cheapest way to learn java?

    I also am a Newbie to the Java language and am trying to get my head around it. I guess it all depends upon how much experience, and at what level, you have with programming in general. I have a good understanding of what my University tutor called "sequential logical thought" but I must confess this Object Oriented approach is, at first, most odd. However the Sun tutorial :
    http://java.sun.com/docs/books/tutorial/java/TOC.html
    : is the one I use the most. If I don't understand a specific computing term then I look it up at :
    http://www.webopedia.com/
    : which is a very good online encyclopedia of computing terms.
    There is also :
    http://www.joegrip.com/
    : which is an online "interactive" tutorial (you have to pay)
    I would advise against rushing out and buying a book until you have spent a whole day trolling through the 'net and seeing what it has to offer . There is a lot out there. The problem is wading through all the nonsense until you find what you're looking for.
    Good luck

  • New To Java. Learning About Java Applet.

    Hi all, i am new to java. Actually i am facing problem with java applet. I am trying to use my cellphone to surf web. When i open a webpage from cellphone, the part which contain the java applet, it cannot be shown and appeared blank. I am using Nokia 7610, can it be solve?
    Can anybody help me? Thank You.

    JSE JRE stand for Sun Java Studio Enterprise 8.1 Final Release or Java SE Runtime Environment (JRE)? Which Shall i download? By the way the file type are .exe and .sh , how to let it become .sis?

  • Oracle oas 10.1.3 oc4j java memory pools info...?

    Hello!
    I need to find info about java memory in JVM. What is :
    PS Eden Space
    PS Old Gen
    PS Perm Gen
    PS Survivor Space
    PS MarkSweep
    PS Scavenge
    regards - Marcin

    user8672998 wrote:
    Hello!
    I need to find info about java memory in JVM. What is :
    PS Eden Space
    PS Old Gen
    PS Perm Gen
    PS Survivor Space
    PS MarkSweep
    PS Scavenge
    regards - MarcinHi Marcin,
    To monitor the java memory and to find info on the memory pools & GC parameters, you must first verify that you are running OC4J on JDK release 5.0, and than you must set the jmxremote property for the OC4J instance.
    Using Application Server Control to Set the jmxremote System Property
    To set the enable monitoring of JVM J2SE 5.0 metrics from Application Server Control:
    1. Navigate to the OC4J Home page for the OC4J instance.
    2. Click Administration to display the OC4J Administration page, which contains a table listing the various administration tasks you can perform for this OC4J instance.
    3. If necessary, expand the Services section of the table by clicking the expand icon or by clicking Expand All.
    4. Click the task icon in the Server Properties row of the table to display the OC4J Server Properties page.
    5. Scroll down to the Command Line Options section of the page and select Enable J2SE 5.0 Platform MBeans.
    6. Click Apply to apply the changes.
    7. Navigate to the Cluster Topology page, select the OC4J instance, and then click Restart.
    Manually Setting the jmxremote System Property
    You can also enable monitoring of JVM J2SE 5.0 metrics manually, by including the following string as an OC4J runtime startup option:
    com.sun.management.jmxremote
    Refer the section "Setting System Properties at Startup" in the Oracle Containers for J2EE Configuration and Administration Guide for detailed instructions on how to specify OC4J runtime startup options.
    Specifically, if you are running OC4J in a standalone environment, you must include the following argument to the OC4J java command:
    java -Dcom.sun.management.jmxremote -jar oc4j.jar
    Or, if you are running OC4J in a Oracle Application Server managed environment, you must include the following argument in the start-parameters java-options element in the opmn.xml file:
    <ias-component id="OC4J">
    <process-type id="home" module-id="OC4J" status="enabled">
    <module-data>
    <category id="start-parameters">
    <data id="java-options" value="-Dcom.sun.management.jmxremote"/>
    </category>
    </module-data>
    </process-type>
    </ias-component>
    Regards,
    ~Pointer

  • Java Memory Management/Out of Memory

    Hi Guys,
    I have a few questions about java memory management
    Because i keep encounter a lot of out of memory error which i think java does not handle Vector/ArrayList re initialisation automatically
    Asumme i have 2 million record in database and , i will process every 80000 and store it in Vector
    while(true)
    list = new Vector();
    list = GetResultFromDatabase() // Process Every 80000
    if list.size() > 0 =======> My VEctor list contain 80000
    //loop the 800000
    //Process Some logic and data
    list.clear();
    list = null;
    If u See , i need to call list.clear and list = Null every process so it wont cause me out of memory
    Before i put that 2 lines , i always hit out of memory Exception.
    Seems like garbage collector cannot claim memory if i dont declare
    Is Memory Occupied by VEctor cannot be recoverable if we dont explitcitynya clear it and set it to NULL??
    Because in term of logic wise it wont cause a problem if i just
    do in this statement after it process like below
    list = new Vector() which will reinstatiate the object.
    Thanks.

    Damm i should hacve read your post again
    Look here:
    while(true)
    list = new Vector();What uer doing is craeting a new vector object everytime the while does an ityteration so when your while loop does 40000 loops there will be 40000 new objects in jou memory
    i sugest moving the decleration outside the while loop:
      list = new Vector();
    while(true)
    ///rest of loop
    } This could also be a problem
    hope it help :-)
    werns

  • Memory space using a 32bit Java process on Redhat Linux

    I have a java process that I need a lot of memory for. Its a 32 bit process, and I have no desire to have it as 64bit due to the huge pointers it forces.
    So I know I can turn to Solaris where I will have close to 4GB of memory available for this process (right?). But are there Linux alternatives? I am especially curious regarding Redhat on intel64 machines as I have (which is the common desktop hardware nowadays).
    I heard about the hugemem kernel for Redhat, but I am lost understading its nature. It is said it is not available for v.5 for x86. So is it available for the intel64 processors as I have? And what is the max memory space for a java process?
    Any other bit of information about java 32bit process running on a linux flavor on an intel64 machine will be greatly appreciated.
    thanks in advance!
    Woody
    Message was edited by:
    Woody.Benoty

    I'd say this is normal. There are a few things to consider when looking at an application like this:
    1. The 14 MB your process consumes include the memory required to load the java virtual machine. That is, all the base classes, native links, the just in time compiler etc. 14 MB isn't a lot, all things considered.
    2. When you display a message box, java will load additional classes and resources. They increase the heap size, though not really by 4 MB. Java preallocates portions of memory for the heap. If, for instance, your application consumes 16 MB of memory and you allocate another MB, the heap size may grow to 32 MB. Having a free section of heap space to spare increases performance, since java won't have to ask the underlying system for free memory every you create an object. You might want to check out your program in JVisualVM (deployed with every JDK6), which will tell you how much of the allocated heap size is really in use, or you can rely on the according methods in the Runtime class.
    3. The JVM is capable of 'heap shrinking', meaning it will return allocated sections of memory to the OS once in a while. However, it will not do so unless the heap size is significantly larger than the used portion of the heap (otherwise, it would defeat the purpose of preallocating memory). So if you allocate 2GB of RAM when clicking your button and allow this memory to be cleared by the garbage collector, you'll observe that the heap will shrink again eventually.

  • Out of memory: Java heap space

    Hello,
    I am working on a project, that simulates large populations, with each individual being a separate Objecta(a couple of kilobytes in size each).
    Once i reach a bug enough number of those Objects (stored in a Vector), i get Out of memory: Java heap space exception.
    Am i having a memory leak in Java? Or am i really reaching the maximal JVM limit and i need to reconfigure it, to support larger heap size?
    :)

    Am i having a memory leak in Java?Because of garbage collection there, by far and large, aren't memory leaks in java. However, there certainly is memory waste.
    If each of these objects you make room for are unnecessarily laden with references to other large objects creating huge networks of objects that never free their memory, and then you allocate 1 million of them, then, while not a leak, you are wasting your memory space.
    Look through your class and inspect each field to see if any of them could be holding more data than you intend. If so, multiply the amount of that data by 1,000,000 or however many objects you are going to instantiate to determine if this produces and absurd amount of memory. You should be able to predict ~how much storage your data will need...each char is 2bytes, each int is 4 bytes, doubles are 8 etc

  • Where to learn about the java bytecode?

    I want to learn the JAVA bytecode. Where to find information about that?

    The list of opcodes, list of data types, and how to use them is here:
    http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
    I personally use BCEL to manipulate class files.
    http://jakarta.apache.org/bcel/
    Some report they prefer Soot.
    http://www.sable.mcgill.ca/soot/

  • I know ZIP about Java. Where Do I Learn?

    I know virtually nothing about Java. I have avoided it but now I want to learn and so far everything I have seen is pretty much Greek. I have used FP2003 and Dreamweaver to build web pages but not delved ino the guts of Java. Where do I begin?
    Ionamic

    Here are some excellent resources for you:
    Installation Notes - JDK 5.0 Microsoft Windows (32-bit)
    Your First Cup of Java
    New to Java Center
    The Java� Tutorial - A practical guide for programmers
    The Java� Tutorial - Trail: Learning the Java Language
    Java Programming Notes - Fred Swartz
    How To Think Like A Computer Scientist
    Introduction to Computer Science using Java
    The Java Developers Almanac 1.4
    Object-Oriented Programming Concepts
    Object-oriented language basics
    Don't Fear the OOP
    Books:
    The Java Programming Language - 4th Edition
    Head First Java, by Bert Bates and Kathy Sierra
    Thinking in Java (Free online), by Bruce Eckel
    Core Java, by Cay Horstmann and Gary Cornell
    Effective Java, by Joshua Bloch
    http://java.sun.com/developer/Books/javaprogramming/
    Good luck, and welcome to Java!
    ~

  • High Eden Java Memory Usage/Garbage Collection

    Hi,
    I am trying to make sure that my Coldfusion Server is optomised to the max and to find out what is normal limits.
    Basically it looks like at times my servers can run slow but it is possible that this is caused by a very old bloated code base.
    Jrun can sometimes have very high CPU usage so I purchased Fusion Reactor to see what is going on under the hood.
    Here are my current Java settings (running v6u24):
    java.args=-server -Xmx4096m -Xms4096m -XX:MaxPermSize=256m -XX:PermSize=256m -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.io.useCanonCaches=false -XX:+UseParallelGC -Xbatch ........
    With regards Memory, the only memory that seems to be running a lot of Garbage Collection is the Eden Memory Space. It climbs to nearly 1.2GB in total just under every minute at which time it looks like GC kicks in and the usage drops to about 100MB.
    Survivor memory grows to about 80-100MB over the space of 10 minutes but drops to 0 after the scheduled full GC runs. Old Gen memory fluctuates between 225MB and 350MB with small steps (~50MB) up or down when full GC runs every 10 minutes.
    I had the heap set to 2GB initally in total giving about 600MB to the Eden Space. When I looked at the graphs from Fusion Reactor I could see that there was (minor) Garbage Collection about 2-3 times a minute when the memory usage maxed out the entire 600MB which seemed a high frequency to my untrained eye. I then upped the memory to 4GB in total (~1.2GB auto given to Eden space) to see the difference and saw that GC happened 1-2 times per minute.
    Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often? i.e do these graphs look normal?
    Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Any other advice for performance improvements would be much appreciated.
    Note: These graphs are not from a period where jrun had high CPU.
    Here are the graphs:
    PS Eden Space Graph
    PS Survivor Space Graph
    PS Old Gen Graph
    PS Perm Gen Graph
    Heap Memory Graph
    Heap/Non Heap Memory Graph
    CPU Graph
    Request Average Execution Time Graph
    Request Activity Graph
    Code Cache Graph

    Hi,
    >Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often?
    Yes normal to garbage collect Eden often. That is a minor garbage collection.
    >Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Sometimes it is good to set Eden (Eden and its two Survivor Spaces combined make up New or Young Generation part of JVM heap) to a smaller size. I know your thinking - what make it less, but I want to make it bigger. Give less a try (sometimes less = more, bigger not = better) and monitor the situation. I like to use -Xmn switch, some sources say to use other method/s. Perhaps you could try java.args=-server -Xmx4096m -Xms4096m -Xmn172m etc. I better mention make a backup copy of jvm.config before applying changes. Having said that now you know how you can set the size to bigger if you want.
    I think the JVM is perhaps making some poor decisions with sizing the heap. With Eden growing to 1Gb then being evacuated not many objects are surviving and therefore not being promoted to Old Generation. This ultimately means the object will need to be loaded again latter to Eden rather than being referenced in the Old generation part of the heap. Adds up to poor performance.
    >Any other advice for performance improvements would be much appreciated.
    You are using Parallel garbage collector. Perhaps you could enable that to run multi-threaded reducing the time duration of the garbage collections, jvm args ...-XX:+UseParallelGC -XX:ParallelGCThreads=N etc where N = CPU cores (eg quad core = 4).
    HTH, Carl.

  • Flash Builder 4.6 Java Heap Space Error

    Hi,
    I get this error "Java Heap Space" when trying to clean build (or build in any way) my project.
    I have a lot of embeded assets (png, mp3 and some binary files embeded to be read as a ByteArray) which total about 37 MB. Including one more 1.6MB binary asset causes this error to occur.
    I have tried to change my memory settings about (-Xmx and -Xms) as previous posts have suggested but this doesn't seem to make any difference.
    Is there any patch or solution to this very frustrating limitation of Flash Builder?
    Thanks for any help!
    Tom

    I constantly had issues with this.  I managed to run into the max for increasing the heap space.  I was able to get beyond the limit by flagging the FlashBuilder.exe file to allow it to allocate to higher memory address ranges.  I'm on a 64 bit machine, so the only limitation was the 32 bit FlashBuilder process.  Anyways i was able to get from 1024m up to 1720m.  Also note that FlashBuilder 4.7 Beta is out and it is a native 64 bit application, so you will get higher addressing there.  I just found it to be too buggy for my every day development tasks.  Also missing the Design view really hurts development.  I hope they put that back in.
    Here's more detail on how I got beyond the java heap ceiling.
    http://chrsmrtn.azurewebsites.net/flash-builder-java-heap-errors-limitations-of-xms-and-xm x/

  • OutOfMemoryError:Java Heap Space on JSP with %@page buffer % directive

    Hi guys,
    I am developing a large report requires a lot of memory using JSP, therefore I allocated about 4096kb in the JSP as follow:
    ==================================================================
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@page buffer="4096kb" %>
    <html>...some work to display report ...</html>
    ==================================================================
    The report runs fine but after few retrieves I got the OutOfMemoryError (OOME) and the only way for me to fix it is to restart the web server (tomcat). I went throught few troubleshooting tests and found out if I take out the <%@page buffer="4096kb" %> in the page, the error will go away regardless how much data I am retrieving from database (In another words, if I put this code into a report to retrieve a small data set, I will still get OOME after few tries). I know you can manually enlarge the Java Memory/Heap size, but it will not fix the problem as it will eventually run out of memory anyway. I am wondering is there known bugs relating to manually allocate buffer size for JSP pages? And how can i deal with it if it is a JSP "Bug"? Or there is something else I am doing wrong. (I have tried manually invoke System.gc() but it will not solve the problem)
    any help is appreciated, Thanks.

    Thanks for these information, you are truely amazing with amount of knowledge you have and your analytical skills.
    Back to the topic:
    <quote>
    Only if you waste time with all the intermediate values that are also too big, and only if you persist in your illusion that you are buying performance with these huge buffers. You aren't. You are buying OutOfMemoryErrors instead.
    You do need to realize that your output will be (i) buffered by the socket send buffer, which is only 8k on Windows, and (ii) transmitted in packets of the path MTU, which is less than 1500 bytes in most cases, so this huge buffer can't possibly do you any good - it just adds latency and OutOfMemoryError risk, as I've been telling you.
    </quote>
    I don't know which part of my replay does not agree with you that setting the buffer size too large is more of an problem other than a solution, perhaps I miss leaded you somehow.
    <quote>That doesn't actually answer the question, does it?</quote>
    Well if a page can be complied and retrieved in the first place, is there enough space to create the page/object? Perhaps you can tell me if I am wrong about it and why.
    I believe the JspWriter object is stored in heap and heap is break up into few sections. I wouldn't be able to tell you for sure which section it resides but my guess is in Eden Space and that space is just about 4MB in space. But remeber I did my test by changing the buffer size to 2MB which is well under the 4MB, I still get the same error.
    <quote>That was what your question was about. OutOfMemoryError using huge buffers. So that's what I focussed on.</quote>
    Yes, you did ponting me out that but what you have done is told me not to use it, which I am very happy with. In my older post, I did actually correct myself and made my question more clear by asking
    "Why with large JSP buffer size, the retrival of the JSP page chewing up the server memory? Shoudlnt memory be released after the page is retrieved?"
    Unfortunitelly I don't think you pointing me anything about it, instead you told me all the reasons not to do it and assuming that I was arguing with you about "it is better to have large buffer jsp size". Again, sorry if I miss leaded you somehow.
    Lets put it this way, even with large jsp buffer size (regardless whether we should be doing that or not) if the memory is freed properly, I will not get OOM error. Am I right?
    <quote>I take out the <%@page buffer="4096kb" %> in the page, the error will go away</quote>
    Yes, but I need to restart my server to make it work. I forgot to mention it, my bad.
    Last, I finally found my answer through web and other forumes. The reason of this happening is because my web server did not release the PageContext object properly which JspWriter is linked to, therefore the memory does not get released at all. So ths the issue that chewing up the server memory. Again, thank you for all your help, your suggestion and knowledge did help me find out my answer in the end.

  • Java Heap Space Error

    Hi,
    We are running SAP MII 12.0 on windows server 2003 SP1 installed on a virtual machine with 4GB RAM, Intel Xenon CPU E5504 @ 2.00 GHz.
    We started getting the Java Heap Space Error while executing a transaction which fetches about 200 rows. But now the error is quiet frequent and appears while trying to open or close the transactions or save trying to save data.
    I have edited the heap space in the config tool to 2048 but this has not helped. Not sure if this is of significance but the SAP R3 server being used is quiet slow and takes about 3 mins to return data when I run the BAPI on it. This resulted in the transaction timing out a few times before we started getting the error. Increasing the connection timeout and read timeout for the transaction has not helped.
    Please help me resolve this
    Thanks
    Maaz Ahmed

    The BAPI being used is BAPI_GOODSMVT_GETITEMS I am specifying the Material, Plant, Goods Mvt ranges, and a date range.
    I was informed that the QA R3 system is not among the best servers and the speeds would be better in production (under 3s).
    Also I have been looking at the sapmmc. Each time I restart the cluster or the server I get a series of messages or alerts. In these alerts I see a series (Content, Navigation, PRT, etc..) of health checks failing. And the last two errors are as below
    Object - Common Information
    Attribute - Failed to Start Application
    Description - 2 appl > 1 appl last reported value above threshold.
    and
    Object - Common Information
    Attribute - Failed to Start Application
    Description - 1 appl > 0 appl last reported value above threshold.
    I am able to launch the menu page after this and when i run the above mantioned BAPI I get the error
    Object - Memory Info
    Attribute - Usage Rate
    Description - 81% > 80% last reported value above threshold

Maybe you are looking for