Java Memory Calculation

Dear all,
I have class
Student{
private int id;
And my program, init array 10000000 student object.
size = 10000000;
Student[] sts = new Student[size];
for(int i = 0; i< size; i++){
sts[i] = new Student();
Learning from
http://www.javamex.com/tutorials/memory/object_memory_usage.shtml
and
http://www.javamex.com/tutorials/memory/array_memory_usage.shtml
I calculation the memory usage for my programe is
- 8: house keeping
- 4 leng
- size * 4 (object reference)
- Each Student object size take (8 byte house keeping + 4 byte for id) = 12, padding 4 => 16 byte
So the total memory is 8 + 4 + 4*size + 16*size = 20*size + 12 ~ 190M
But the momory usage for my program is 277MB. That is the large difference.
Could you give me some advice?
Thank a lot for support.

Helo..
Using Windows Task manager is not the proper way to measure a Java programs Memory usage.
Reason:When you run a java program ,it also requires the underlying JRE to run ,so the memory used for a java process in this case would be the memory for the Java programs Objects and also for the entire JRE.
The Best way to measure your application's performance is use either of the two free tools:
1.JConsole-its comes along with JDK. JDK_HOME/bin/jconsole
2.Any Profiler Programs:A profiler for Java is a program which allows you to trace a running java program and see the memory and CPU consumption for the Java application.Netbeans comes with its own profiler.you can chk this out.
The other option is to measure free memory before and after execution of the program using System Util Class.
Hope this clarifies your qn.
Thanks.

Similar Messages

  • How to determine the java memory cosumption

    Hi.
    In our system Netweaver7.1, (on windows)
    I want to know java heap memory consumption.
    We can see the memory consumption from windows task manager, but the AS JAVA caught the memory heap memory size during startup.
    So itisn't correct.
    In NWA, many paerformance monitors are, but I don't know which tool is useful.
    I want to sizing the memory size with following logic.
    8:00~9:00 50% load
    The java memory is conusmed 3GB.
    11:00~12:00 100% load
    The java memorry will "may" be consumed 6GB.
    regards,

    I found the directory with java.exe on my XP client. After updating my Path and then typing 'java -versions' I still see a 'java not found message'. No problem though - a README.TXT says that I have JRE 1.1.7B.
    One final question - a co-worker who also has XP just starting seeing a pop-up window saying 'Runtime' error when running a Java applet. His java.exe is in a path that includes the sub-directory 'JRE' On my XP client, java.exe is in a path which includes a 'JRE11' sub-directory. We therefore seem to have different versions of the JRE. Since I don't see the Runtime error when running the same applet, should my co-worker try upgrading his JRE?
    Thank you.

  • 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

  • Java Memory Problem

    Hi,
    We are using apache and tomcat webserver for our site (built on Unix). We are experiencing a serious problem with java memory.
    For every 1 hour (at around 1000-1500 page hits), site is getting down and giving error,'java.lang.OutOfMemoryError'.
    We observed that the memory consumed by java parocess is not being garbage collected. It is building up gradually and reaching its max limit(128M), and then site is getting down, throwing exception 'java.lang.OutOfMemoryError'.
    I dont under stand what to do.
    Can you please suggest me what to do to fix the problem..
    thankyou,
    Mo

    Test run your server with java -Xloggc:<file> option which logs GC activity. This should give you a clue as to how often gc is running and how much of mem it reclaimed in each cycle. This is just an initial test. Once u know for sure that enough mem is not being reclaimed then you use some memory profiler tools and identify the memory leak and fix the code to release unwanted references.

  • Analysing SAP Java Memory Usage in Unix/Linux

    Hi,
    I need to analyze the SAP Java memory usage of Unix /Linux machine..NW 7.0
    Please guide with the commands and steps..complete prcedure.
    Based on it I should decide whether to create a new server node (or) increasing heap size
    Thanks in advance

    Hi,
    Do you have performance problems?
    How many CPU's are in the server?
    Did you check Log Configuration for delays or errors?
    Did you tune any exisiting parameters?
    You can add the nodes only if there is performance problems. You may think of adding one node to start with
    Proper number of server nodes within an instance:
    u2013 #ServerNodes = availableMemory / (JavaHeapPermSpaceStack)
    You can calculate the server nodes based on below formula
    No. of server Node = (RAM you want to assign or available RAM in GB)/2.5 ============> for 64-bit system
    No. of server Node = (RAM you want to assign or available RAM in GB)/1.5 ============> for 32-bit system
    Hence as per above discussion, we should go with 5 server nodes means,
    5 = RAM/2.5 (Assuming you are on 64-bit platform)
    i.e. RAM = 12.5 GB
    2). u2013 Configure JVM heap according to Note 723909 and Note 1008311 - Recommended Settings for NW 7.0 >= SR2 for the AIX JVM (J9)

  • High Java memory consumption.

    Hello,
    We are developing a solution using Servoy, which is a database server framework built in java. We have now 2 Servoy instances running on Debian linux servers, one with 64bit, both of them running java 1.6 update 26. We are having lot of crashes of the server with this error log:
    # There is insufficient memory for the Java Runtime Environment to continue.
    # Native memory allocation (malloc) failed to allocate 32776 bytes for Chunk::new
    # Possible reasons:
    # The system is out of physical RAM or swap space
    # In 32 bit mode, the process size limit was hit
    # Possible solutions:
    # Reduce memory load on the system
    # Increase physical memory or swap space
    # Check if swap backing store is full
    # Use 64 bit Java on a 64 bit OS
    # Decrease Java heap size (-Xmx/-Xms)
    # Decrease number of Java threads
    # Decrease Java thread stack sizes (-Xss)
    # Set larger code cache with -XX:ReservedCodeCacheSize=
    # This output file may be truncated or incomplete.
    # Out of Memory Error (allocation.cpp:317), pid=12359, tid=1777961872
    # JRE version: 6.0_26-b03
    # Java VM: Java HotSpot(TM) Server VM (20.1-b02 mixed mode linux-x86 )
    --------------- T H R E A D ---------------
    Current thread (0x092c8400): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=12368, stack(0x69f18000,0x69f99000)]
    Stack: [0x69f18000,0x69f99000], sp=0x69f95fe0, free space=503k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [libjvm.so+0x7248b0]
    We checked both the heap memory and the memory used by java in this case and we notice a highly increase of the total java memory, while the heap memory is resonable:
    JVM Information
    java.vm.name=Java HotSpot(TM) Server VM
    java.version=1.6.0_26
    java.vm.info=mixed mode
    java.vm.vendor=Sun Microsystems Inc.
    Operating System Information
    os.name=Linux
    os.version=2.6.29-xs5.5.0.17
    os.arch=i386
    System Information
    Heap memory: allocated=141440K, used=105555K, max=699072K
    None Heap memory: allocated=49312K, used=49018K, max=180224K
    root 16388 2.5 43.0 2829220 1811772 ? Sl 20:11 3:43 java -Djava.awt.headless=true -Xmx768m -Xms128m -XX:MaxPermSize=128m -classpath .:lib/ohj-jewt.jar:lib/MRJAdapter.jar:lib/compat141.ja
    Right now we are running it on the 64bit machine with -Xmx256m -Xms64m, and the memory is the same as on the 32bit one.
    We also tried different memory configurations, but the result is the same. Java goes up to more the 2GB of memory used, while the heap is about 100MB - 400MB. In the output above you can see 1.8GB used, but this is at startup, after few hours it goes to more then 2GB - 2.5GB, then it crashes in at most few days, sometimes in few hours or even less.

    Can the profiler see more then the heap? OK, I'll try to profile the server.
    Servoy uses Tomcat 5.
    The OS we run on is Debian. The 64bit machine is this:
    JVM Information
    java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    java.version=1.6.0_26
    java.vm.info=mixed mode
    java.vm.vendor=Sun Microsystems Inc.
    Operating System Information
    os.name=Linux
    os.version=2.6.32-5-amd64
    os.arch=amd64
    and the current memory usage is this:
    System Information
    Heap memory: allocated=253440K, used=228114K, max=253440K
    None Heap memory: allocated=112512K, used=112223K, max=180224K
    , while the java process memory is this:
    root 11629 6.9 44.4 2105640 1829808 hvc0 Sl 11:42 14:18 java -Djava.awt.headless=true -Xmx256m -Xms64m -XX:MaxPermSize=128m -classpath .:lib/ohj-jewt.jar:lib/MRJAdapter.jar:lib/compat141.jar:lib/commons-codec.jar:lib/commons-httpclient.jar:lib/activation.jar:lib/antlr.jar:lib/commons-collections.jar:lib/commons-dbcp.jar:lib/commons-fileupload-1.2.1.jar:lib/commons-io-1.4.jar:lib/commons-logging.jar:lib/commons-pool.jar:lib/dom4j.jar:lib/help.jar:lib/jabsorb.jar:lib/hibernate3.jar:lib/j2db.jar:lib/j2dbdev.jar:lib/jdbc2_0-stdext.jar:lib/jmx.jar:lib/jndi.jar:lib/js.jar:lib/jta.jar:lib/BrowserLauncher2.jar:lib/jug.jar:lib/log4j.jar:lib/mail.jar:lib/ohj-jewt.jar:lib/oracle_ice.jar:lib/server-bootstrap.jar:lib/servlet-api.jar:lib/wicket-extentions.jar:lib/wicket.jar:lib/wicket-calendar.jar:lib/slf4j-api.jar:lib/slf4j-log4j.jar:lib/joda-time.jar:lib/rmitnl.jar:lib/networktnl.jar com.servoy.j2db.server.ApplicationServer
    About another app, I'm confused, because we do have another java app that uses much less:
    root      1149  0.3  2.1 843312 86988 ?        Sl   10:16   0:58 java -Xmx512m -Xms128m -cp noaa_server.zip server.WebServer
    and for this one, the heap is this:
    Memory: total: 129892352, free: 114666408, maximum: 518979584
    So yes, this one looks better. It uses 15MB from heap and 80MB in total from ram.
    But still, I don't get it, how can the process memory be affected while the heap is much low?
    Edited by: 897090 on Nov 14, 2011 6:35 AM
    Edited by: 897090 on Nov 14, 2011 6:39 AM
    Edited by: 897090 on Nov 14, 2011 6:40 AM

  • Web Service data source report causes Java memory leak

    Crystal Report designer fails to preview a report whose data source is a WSDL web service.  This happens when the Java run time process has exceeded the memory limit specified in the CRConfig.xml file.  The Java memory is never released by Crystal Reports until the Crystal Reports Designer is closed.  Version is Crystal reports 2008 (product version 12.2.4.507).
    This error also occurs in the Crystal Reports Viewer when used in a Microsoft .NET application (framework 3.5) referencing CrystalDecisions.CrystalReports.Engine.dll v12.0.2000.0, CrystalDecisions.Enterprise.Framework.dll v12.0.1100.0, CrystalDecisions.Enterprise.InfoStore.dll v12.0.1100.0, CrystalDecisions.ReportSource.dll v12.0.2000.0, CrystalDecisions.Shared.dll v12.0.2000.0
    I load the ReportDocument object based on the location of the .rpt file and then set the ReportSource object of the CrystalReportViewer control:
    string FullReportName = "TestFile.rpt";
    ReportDocument reportDoc = new ReportDocument();
    reportDoc.Load(FullReportName, OpenReportMethod.OpenReportByTempCopy);
    this.crystalReportViewer1.ReportSource = reportDoc;
    reportDoc.Close();
    reportDoc.Dispose();
    GC.Collect();
    The code displays the report in the report viewer.  However, every time the report is refreshed the Java runtime memory increases until the application cannot display the results.  The error messages are "Failed to retrieve data from the database." followed by "Cannot determine the queries necessary to get data for this report. Details: Unexpected error".  If you try to refresh the data once again the following errors occur: "Failed to retrieve data from the database." then "Cannot determine the queries necessary to get data for this report. Details: Schema file is invalid   Java heap space".
    Increasing the java heap space in the CRConfig.xml file merely prolongues the onset of this error.
    Is there a service pack or hot fix for this???
    PLEASE HELP.

    Many thanks for your help.  This solved the issue for our .NET code, however the leak is still present in the report designer.  I was also wondering if you could help further: because of the limits on the java memory process is there a way to ensure that a separate java process is started for each report that is loaded in my report viewers collection?  Essentially the desktop application that i have created uses a tab control to display each type report, so each tab goes through the following code when displaying a report and closing a tab:
    Is there a way to ensure that a different Java process is kicked off each time that I display a different report?  My current code in c# always uses the same Java process so the memory ramps up.  The code to load the report and then dispose of the report through closing the tab (and now the Java process) looks like this:
        private void LoadCrystalReport(string FullReportName)
          ReportDocument reportDoc = new ReportDocument();
          reportDoc.Load(FullReportName, OpenReportMethod.OpenReportByTempCopy);
          this.crystalReportViewer1.ReportSource = reportDoc;
        private void DisposeCrystalReportObject()
          if (crystalReportViewer1.ReportSource != null)
            ReportDocument report = (ReportDocument)crystalReportViewer1.ReportSource;
            foreach (Table table in report.Database.Tables)
              table.Dispose();
            report.Database.Dispose();
            report.Close();
            report.Dispose();
            GC.Collect();
    Thanks

  • Diagnostics Workload Analysis - Java Memory Usage gives BI query input

    Dears
    I have set up diagnostics (aka root cause analysis) at a customer side and I'm bumping into the problem that on the Java Memory Usage tab in Workload analyis the BI query input overview is given
    Sol Man 7.0 EHP1 SPS20 (ST component SP19)
    Wily Introscope 8.2.3.5
    Introscope Agent 8.2.3.5
    Diagnostics Agent 7.20
    When I click on the check button there I get the following:
    Value "JAVA MEMORY USAGE" for variable "E2E Metric Type Variable" is invalid
    I already checked multiple SAP Notes like the implementation of the latest EWA EA WA xml file for the Sol Man stack version.
    I already reactivated BI content using report CCMS_BI_SETUP_E2E and it gave no errors.
    The content is getting filled in Wily Introscope, extractors on Solution Manager are running and capturing records (>0).
    Did anyone come accross this issue already?
    ERROR MESSAGE:
    Diagnosis
    Characteristic value "JAVA MEMORY USAGE" is not valid for variable E2E Metric Type Variable.
    Procedure
    Enter a valid value for the characteristic. The value help, for example, provides you with suggestions. If no information is available here, then perhaps no characteristic values exist for the characteristic.
    If the variable for 0DATE or 0CALDAY has been created and is being used as a key date for a hierarchy, check whether the hierarchies used are valid for this characteristic. The same is valid for variables that refer to the hierarchy version.
      Notification Number BRAIN 643 
    Kind regards
    Tom
    Edited by: Tom Cenens on Mar 10, 2011 2:30 PM

    Hello Paul
    I checked the guide earlier on today. I also asked someone with more BI knowledge to take a look with me but it seems the root cause analysis data fetching isn't really the same as what is normally done in BI with BI cubes so it's hard to determine why the data fetch is not working properly.
    The extractors are running fine, I couldn't find any more errors in the diagnostics agent log files (in debug mode) and I don't find other errors for the SAP system.
    I tried reactivating the BI content but it seems to be fine (no errors). I reran the managed system setup which also works.
    One of the problems I did notice is the fact that the managed SAP systems are half virtualized. They aren't completely virtualized (no seperate ip address) but they are using virtual hostnames which also causes issues with Root Cause Analysis as I cannot install only one agent because I cannot assign it to the managed systems and when I install one agent per SAP system I have the message that there are already agents reporting to the Enterprise Manager residing on the same host. I don't know if this could influence the data extractor. I doubt it because in Wily the data is being fetched fine.
    The only thing that it not working at the moment is the workload analysis - java memory analysis tab. It holds the Key Performance Indicators for the J2EE engine (garbage collection %). I can see them in Wily Introscope where they are available and fine.
    When I looked at the infocubes together with a BI team member, it seemed the infocube for daily stats on performance was getting filled properly (through RSA1) but the infocube for hourly stats wasn't getting filled properly. This is also visible in the workload analysis, data from yesterday displays fine in workload analysis overview for example but data from an hour ago doesn't.
    I do have to state the Solution Manager doesn't match the prerequisites (post processing notes are not present after SP-stack update, SLD content is not up to date) but I could not push through those changes within a short timeframe as the Solution Manager is also used for other scenarios and it would be too disruptive at this moment.
    If I can't fix it I will have to explain to the customer why some parts are not working and request them to handle the missing items so the prerequisites are met.
    One of the notes I found described a similar issue and noted it could be caused due to an old XML file structure so I updated the XML file to the latest version.
    The SAPOscol also throwed errors in the beginning strange enough. I had the Host Agent installed and updated and the SAPOscol service was running properly through the Host Agent as a service. The diagnostics agent tries to start SAPOscol in /usr/sap/<SID>/SMDA<instance number>/exe which does not hold the SAPOscol executable. I suppose it's a bug from SAP? After copying the SAPOscol from the Host Agent to the location of the SMD Agent the error disappeared. Instead the agent tries to start SAPOscol but then notices SAPOscol is already running and writes in the log that SAPOscol is already running properly and a startup is not neccesary.
    To me it comes down the point where I have little faith in the scenario if the Solution Manager and the managed SAP systems are not maintained and up to date 100%. I could open a customer message but the first advice will be to patch the Solution Manager and meet the prerequisites.
    Another pain point is the fact that if the managed SAP systems are not 100% correct in transaction SMSY it also causes heaps of issues. Changing the SAP system there isn't a fast operation as it can be included in numerous logical components, projects, scenario's (CHARM) and it causes disruption to daily work.
    All in all I have mixed feelings about the implementation, I want to deliver a fully working scenario but it's near impossible due to the fact that the prerequisites are not met. I hope the customer will still be happy with what is delivered.
    I sure do hope some of these issues are handled in Solution Manager 7.1. I will certainly mail my concerns to the development team and hope they can handle some or all of them.
    Kind regards
    Tom

  • Java memory consumption

    Hi
    I want to know how much java memory is used.
    How can I know the memory comsumption.
    regards,

    Hai,
    Please check the below link.....
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0eaafd5-6ffd-2910-019c-9007a92b392f
    Regards,
    Yoganand.V

  • DAC Service shuts down with Java Memory when regenerating indexes.

    We have set up to run the DAC as a windows service. We have just set up a new execution plan comprising subject areas from Financials and Inventory. When we run the first full load, the execution plan executes all steps, but when it starts to run the last task: QUERY_INDEX_CREATION, the DAC service shuts down subsequently failing the execution plan. In the stderr.log we see the following:
    11-11-2008 16:44:59 global
    SEVERE:
    ANOMALY INFO:::
    MESSAGE:::Database Object should be specified for sql commands.
    EXCEPTION CLASS::: com.siebel.analytics.etl.etltask.TaskInitializationException
    com.siebel.analytics.etl.etltask.SQLTask.doInit(SQLTask.java:86)
    com.siebel.analytics.etl.etltask.CountTableTask.doInit(CountTableTask.java:59)
    com.siebel.analytics.etl.etltask.GenericTaskImpl.init(GenericTaskImpl.java:129)
    com.siebel.etl.engine.core.Session.getTargetTableRowCounts(Session.java:3057)
    com.siebel.etl.engine.core.Session.run(Session.java:2972)
    java.lang.Thread.run(Thread.java:619)
    11-11-2008 16:45:04 global
    SEVERE: MESSAGE:::Java heap space
    EXCEPTION CLASS::: java.lang.OutOfMemoryError
    java.util.Arrays.copyOfRange(Arrays.java:3209)
    java.lang.String.<init>(String.java:216)
    java.lang.StringBuilder.toString(StringBuilder.java:430)
    com.siebel.etl.engine.core.IndexPropertyFactory.createIndexProperty(IndexPropertyFactory.java:28)
    com.siebel.etl.engine.core.Index.<init>(Index.java:71)
    com.siebel.etl.engine.core.TableIndexHandler.loadIndexes(TableIndexHandler.java:329)
    com.siebel.etl.engine.core.TableIndexHandler.populate(TableIndexHandler.java:96)
    com.siebel.etl.command.IndexCreationCommand.doExecute(IndexCreationCommand.java:64)
    com.siebel.etl.command.SqlCommand.doExecute(SqlCommand.java:9)
    com.siebel.etl.command.MultiSourceSqlCommand.execute(MultiSourceSqlCommand.java:82)
    com.siebel.etl.database.AsyncDatabaseCall.run(AsyncDatabaseCall.java:34)
    java.lang.Thread.run(Thread.java:619)
    11-11-2008 16:45:04 global
    SEVERE: MESSAGE:::Java heap space
    EXCEPTION CLASS::: java.lang.OutOfMemoryError
    java.util.Arrays.copyOfRange(Arrays.java:3209)
    java.lang.String.<init>(String.java:216)
    oracle.jdbc.driver.CharCommonAccessor.getString(CharCommonAccessor.java:385)
    oracle.jdbc.driver.T4CVarcharAccessor.getString(T4CVarcharAccessor.java:411)
    oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:397)
    oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
    com.siebel.etl.database.DAWResultSet.getString(DAWResultSet.java:597)
    com.siebel.etl.engine.core.TableIndexHandler.loadIndexes(TableIndexHandler.java:301)
    com.siebel.etl.engine.core.TableIndexHandler.populate(TableIndexHandler.java:96)
    com.siebel.etl.command.IndexCreationCommand.doExecute(IndexCreationCommand.java:64)
    com.siebel.etl.command.SqlCommand.doExecute(SqlCommand.java:9)
    com.siebel.etl.command.MultiSourceSqlCommand.execute(MultiSourceSqlCommand.java:82)
    com.siebel.etl.database.AsyncDatabaseCall.run(AsyncDatabaseCall.java:34)
    java.lang.Thread.run(Thread.java:619)
    11-11-2008 16:45:05 global
    SEVERE: Failed due to the following reason: Java heap space
    11-11-2008 16:45:05 global
    SEVERE: Failed due to the following reason: Java heap space
    11-11-2008 16:45:10 global
    SEVERE: MESSAGE:::Java heap space
    EXCEPTION CLASS::: java.lang.OutOfMemoryError
    This is repeated many times in the log. It manages to create some indexes, but eventually it shuts down the DAC windows service
    In the windows event viewer we then see this at 11-11-2008 16:
    "The Java Virtual Machine has exited with a code of 10, the service is being stopped."
    My guess is that we need to allocate more memory to the DAC Java VM, but how/where?
    Any ideas?
    best regards,
    Henrik Verup
    Edited by: [email protected] on Nov 20, 2008 10:34 AM
    We have managed to work around the problem, by changing the DAC Sytem Property (under Setup): CreateQueryIndexesAtTheEnd from true to false. This way, indexes are being rebuilt during the load - not at the end. This has helped in getting the execution pla to finisf succesfully. We are now working on how to increase Java heap memory of the DAC Server, when started as a windows service. We have installed a windows service to stop and start the DAC serve,r using a document by Olivier Lemaire from Oracle.
    Does anyone have experiences on this?

    java Heap memory in DAC can be increased from the Client Side .
    Open the file for editing----startclient
    echo off
    title Siebel DAC Client
    call config.bat
    Rem Uncomment the below if you want to see a DOS window with messages.
    Rem and comment out the JAVAW line.
    Rem
    Rem %JAVA% -Xms256m -Xmx1024m -cp %DACCLASSPATH% com.siebel.analytics.etl.client.view.EtlViewsInitializer
    Rem
    start %JAVAW% -Xms256m -Xmx1024m -cp %DACCLASSPATH% com.siebel.analytics.etl.client.view.EtlViewsInitializer
    edit 1024 and increase the heap memory sizee,this should work.We faced a similar issue and increasing the size of the java memory solved the issue.
    Let me know if this is solved

  • 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

  • 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.

  • Java Memory Monitoring in Web Application

    Hi All,
    Request you to please review the below mentioned suggestion and provide inputs:
    Over the years, I have been involved in some projects involving web development in J2ee. JAVA memory usage is an issue that is common amongst all.
    Following are some of the questions that come across to a developer regarding the JAVA memory:
    Memory Usage Statistics.
    Trending of Memory statistics.
    Memory Leak.
    Performance optimization in case memory leaks occur.
    When it comes to answering the above, the most common suggestion is to enable heap dumps and analyze it using a heap analyzer tool. However, there are times and projects where these options are not approved off and developer is always asked to review code again and again. This is again a frustrating option for someone who has just joined a maintenance project and reading through code is not a feasible option. It has happened to me and I did the following to solve some of my problems and eventually all.
    Instead of analyzing heap dumps, I decided to do the following:
    Add a request filter to my J2EE application.
    Add following log statements in the filter:
    URL fired.
    Runtime.getRuntime().freeMemory()
    Runtime.getRuntime().totalMemory()
    Runtime.getRuntime().maxMemory()
    Gather data from daily app usage and build some trending statistics.
    Not only were we able to decide an optimum memory setting for our server, we were able to detect leaks as well. However, i agree detecting leaks wasn't as simple as it's with other tools considering the debugging effort that's involved.It is not a conventional approach but come sin handy when projects don't want to involve costs and maintain equilibrium at production systems as well.

    Hi,
    Few questions!
    1> Have you tweaked your jvm?
    2> What are the values given for Xms and Xmx?
    3> What is the size of XX:MaxPermGen?
    4> How much RAM is available on the system where you have deployed your app?
    5> Are you using pre-complied JSPs for faster response?
    6> Which JDK are you using?
    7> Have you tried using latest version of Tomcat?
    8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
    I hope answering these questions would help you :)
    njoy!

  • Claculator.java+memory buttons

    hey this is my code
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Calculator extends JApplet implements ActionListener
    {     // declare all instances and variables
         JLabel displayLabel,inputLabel;
         JTextField displayBox,inputBox;
         JButton clearButton, addButton,subtButton,multButton,divButton,sqrtButton,sqrButton,recipButton,posnegButton,MSButton,MRButton,MPButton,MCButton;
         double display_total, new_value, mem_value;
         public void init()
         {     // create and add display box
              setLayout(new FlowLayout());
              displayLabel = new JLabel("Display");
                displayBox = new JTextField(12);
              add(displayLabel);
              add(displayBox);
              displayBox.setEditable(false);
              display_total = 0.0;
              displayBox.setText(Double.toString(display_total));
              // create and add input box
              inputLabel = new JLabel("Input");
                inputBox = new JTextField(12);
              add(inputLabel);
              add(inputBox);
              //create and add add button
              addButton = new JButton(" + ");
              add(addButton);
              addButton.addActionListener(this);
              //create and add subtract button
              subtButton = new JButton(" - ");
              add(subtButton);
              subtButton.addActionListener(this);
              //create and add multiply button
              multButton = new JButton(" * ");
              add(multButton);
              multButton.addActionListener(this);
              //create and add divide button
              divButton = new JButton(" / ");
              add(divButton);
              divButton.addActionListener(this);
              //create and add clear button
              clearButton = new JButton("Clear");
              add(clearButton);
              clearButton.addActionListener(this);
              //create and add square root button
              sqrtButton = new JButton(" SQT ");
              add(sqrtButton);
              sqrtButton.addActionListener(this);
              //create and add square button
              sqrButton = new JButton(" SQR ");
              add(sqrButton);
              sqrButton.addActionListener(this);
              //create and add reciprocate button
              recipButton = new JButton(" 1/X ");
              add(recipButton);
              recipButton.addActionListener(this);
              //create and add reciprocate button
              posnegButton = new JButton(" +/- ");
              add(posnegButton);
              posnegButton.addActionListener(this);
              //create and add memory save button
              MSButton = new JButton(" MS ");
              add(MSButton);
              MSButton.addActionListener(this);
              //create and add memory retreive button
              MRButton = new JButton(" MR ");
              add(MRButton);
              MRButton.addActionListener(this);
              //create and add memory addition button
              MPButton = new JButton(" M+ ");
              add(MPButton);
              MPButton.addActionListener(this);
              //create and add memory clear button
              MCButton = new JButton(" MC ");
              add(MCButton);
              MCButton.addActionListener(this);
         }// init
         public void actionPerformed(ActionEvent event)
         // to respond to clicking on buttons     
         {     // to determine which button was clicked
              String arg = event.getActionCommand();
              if (arg.equals("Clear"))     // Clear button clicked
              {     display_total = 0.0;
                   displayBox.setText(Double.toString(display_total));
              }//clear
              else     // a new value has been entered                    
              {  try
                      {      new_value = Double.valueOf(inputBox.getText()).doubleValue();
                        showStatus("");
                        if(arg.equals(" + "))     // add button clicked
                             display_total = display_total + new_value;
                        else if (arg.equals(" - "))     // subtract button clicked
                             display_total = display_total - new_value;
                        else if (arg.equals(" * "))     // multiply button clicked
                             display_total = display_total * new_value;
                        else if (arg.equals(" / ")) // divide button clicked
                             display_total = display_total / new_value;
                        else if (arg.equals(" SQT ")) // square root button clicked
                             display_total = Math.sqrt(new_value);
                        else if (arg.equals(" SQR ")) // square button clicked
                             display_total = new_value * new_value;
                        else if (arg.equals(" 1/X ")) // reciprocal button clicked
                             display_total = 1/new_value;
                        else if (arg.equals(" +/- ")) // positive negative button clicked
                             display_total = new_value-(new_value*2);
                        else if (arg.equals(" MS ")) // memory save button clicked
                             mem_value=new_value;
                        else if (arg.equals(" MR ")) // memory retreive button clicked
                             new_value=mem_value;
                        else if (arg.equals(" M+ ")) // memory addition button clicked
                             mem_value=mem_value+new_value;
                        else if (arg.equals(" MC ")) // memory clear button clicked
                             mem_value=0.0;
                        displayBox.setText(Double.toString(display_total));
                        inputBox.setText("");
                   }//try          
                      catch (NumberFormatException entry)
                      {     showStatus("Error: Invalid Input");
                        inputBox.setText("");
                      }//catch          
              }//else
         }//actionPerformed
    }//Calculatorit all runs fine unitl the memory buttons, they dont seem to work. when i press the memory retrieve button, i get the invalid input message, and the same message for the m+ and mc buttons. ms seems to work fine, as no error message is displayed. can someone help me fix this please?

    This:
    else if (arg.equals(" +/- ")) // positive negative button clicked
       display_total = new_value-(new_value*2);should be:
    else if (arg.equals(" +/- ")) // positive negative button clicked
       display_total = -new_value;Much clearer as to what it does (and fewer operations, too).
    Memory Retrieve and Memory Clear don't need an input--that's probably why you are getting the exception--you are probably parsing an empty string.
    As CeciNEstPasUnProgrammeur said, you should print the stack trace.

  • Problem with Java Memory "Could not reserve enough space for object heap"

    Hi gurus,
    I am not an expert with Java´s configuration, and I have a situation that I don´t understand. First of all, I am working at Centos 6.2 with jdk_1.6 and Tomcat 7.
    The problem is...
    - If I run Tomcat with JAVA_OPTS="-Xmx128m"* (at catalina.sh) all works fine.
    - If I run Tomcat with JAVA_OPTS="-Xmx512m"* (at catalina.sh) an error appears:
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
    This appear when I run java -version or when I try to stop Tomcat, and the Tomcat isn´t able to stop.
    The strange thing is that my server has more than 200M free in physical memory. So, why Tomcat isn´t able to stop? and Why Java doesn´t use the free memory in my server?
    Thanks in advanced.

    Hello EJP, thanks for your answer.
    I have explained bad.
    The server has 703M free when Tomcat is stopped. I had mentioned that my server has more than 200M free in physical memory when Tomcat is running with JAVA_OPTS="-Xmx512m", so I don´t understand why these errors appear.
    Do you understand me?
    Recently I have checked the swap memory, and it is disabled. In spite of swap memory is disabled I think java wouldn´t need this memory because it has free physical memory
    Thanks again.

Maybe you are looking for

  • HT4623 Why my iPhone doesn't connect with my wi-fi since the iOS 7 update?

    My phone no longer connects to wi fi since I upgraded to ios7.  It tells me it has updates but can only update it using wi-fi.  How can I do this if it will no longer connect to my home wi-fi or any other. Our iPad is fine.  Its just my phone.  Tried

  • ECC 6.0 : XPRA for SAPKA70019 fails

    During support package implementation of SAPKA70019 the final step XPRA GENERATION fails with : 1 ETP199X######################################                                                                             1 ETP162 EXECUTION OF REPORTS

  • IPhoto Themes

    Hi, I am unable to print using iPhoto 08 version 7.1.5 (running MacOS 10.5.6)as I am told that I need to install themes. Checking the application support folder, I see that the iPhoto folder has all the themes in it with version.plist in the contents

  • Organizer & Tags in Premiere Elements 7

    I am interested in upgrading from Premiere Elements 4 to Premiere Elements 7 in part because of the Organizer, since I use a lot of stills in my projects. I also use Photoshop CS3 & Bridge CS3. It seems Bridge does not see the PRE 7 tags. Where are t

  • Sorting dynamic table

    All,   Anybody know how to sort a dynamically created internal table ?   I've got this dynamic table with 3 fields   VBELN POSNR MATNR   and would like to sort this ?   normally it's sort int_table by vbeln posnr matnr but that's not working with a d