Exception in thread "main" java.lang.OutOfMemoryError

When I try to run this program, I get the error, the program is supposed to display 400 prime numbers. Is it because of the system I am running it on?
System: OSX, 256 Ram, 1.25GHz,

Hi,
Please refer to the following note in Metalink , This may solve your problem.
Note:315477.1 : XML Report Publisher Fails With java.lang.OutOfMemoryError
Kind Regards,
Mahi

Similar Messages

  • FB 4.7 AIR 3.6 Flex 4.9 iOS packing - Exception in thread "main" java.lang.OutOfMemoryError'

    I've got an error similar to Isaac_Sunkes' 'FB 4.7 iOS packaging - Exception in thread "main" java.lang.OutOfMemoryError',
    but the causes are not related to what he discovered, corrupt image or other files, I'd exclude bad archive contents in my project.
    I'm using Flash Builder 4.7 with Adobe AIR 3.6 set into an Apache Flex 4.9.1 SDK;
    HW system is:
    iMac,    2,7 GHz Intel Core i5,    8 GB 1600 MHz DDR3,    NVIDIA GeForce GT 640M 512 MB,    OS X 10.8.2 (12C3103)
    The Flash project consists in an application with a main SWF file which loads, via ActionScript methods, other SWF in cascade.
    I've formerly compiled and run the application on an iPad 1, IOS 5.0.1 (9A405), but got on the device the error alert:
    "Uncompiled ActionScript
    Your application is attempitng to run
    uncompiled ActionScript, probably
    due to the use of an embedded
    SWF. This is unsupported on iOS.
    See the Adobe Developer
    Connection website for more info."
    Then I changed the FB compiler switches, now are set to:
    -locale en_US
    -swf-version=19
    Please note that without the switch    -swf-version=19     the application is compiled correctly and the IPA is sent to the device
    and I can debug it, but iOS traps secondary SWF files and blocke the app usage, as previously told.
    they work on deploy of small applications,
    but, when I try to build a big IPA file either for an ad-hoc distribution, either for an debug on device, after some minutes long waiting, I get a Java stuck, with this trace:
    Error occurred while packaging the application:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.addEntry(HashMap.java:753)
        at java.util.HashMap.put(HashMap.java:385)
        at java.util.HashSet.add(HashSet.java:200)
        at adobe.abc.Algorithms.addUses(Algorithms.java:165)
        at adobe.abc.Algorithms.findUses(Algorithms.java:187)
        at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4731)
        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3615)
        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2309)
        at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:532)
        at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:341)
        at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler .java:599)
        at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:104)
    I've tried to change the Java settings on FB's eclipse.ini in MacOS folder,
    -vmargs
    -Xms(various settings up to)1024m
    -Xmx(various settings up to)1024m
    -XX:MaxPermSize=(various settings up to)512m
    -XX:PermSize=(various settings up to)256m
    but results are the same.
    Now settings are back as recommended:
    -vmargs
    -Xms256m
    -Xmx512m
    -XX:MaxPermSize=256m
    -XX:PermSize=64m
    I've changed the Flex build.properties
    jvm.args = ${local.d32} -Xms64m -Xmx1024m -ea -Dapple.awt.UIElement=true
    with no results; now I'n get back to the standard:
    jvm.args = ${local.d32} -Xms64m -Xmx384m -ea -Dapple.awt.UIElement=true
    and now I truely have no more ideas;
    could anyone give an help?
    many thanks in advance.

    I solved this. It turns out the app icons were corrupt. After removing them and replacing them with new files this error went away.

  • J2ee server Exception in thread Main java.lang.OutOfMemoryError

    hallo
    i need your help
    first my java j2ee and jdk
    j2ee j2sdkee1.3.1
    jdk j2sdk 1.4
    i nedd the server for jms.
    when i started the server with j2ee -verbose
    i get the error message:
    Starting web service at port: 8000
    Exception in thread "Main" java.lang.OutOfMemoryError
    what can i do to get out off this error message and starting the server normal. please help me to solve the problem!!!
    i read in this forum about -Xms und Xmx but this Commands don't go on my system.
    thx for help!!!

    Hi Warren,
    Still I am not clear with your question. But generally this out of memoryspace error can be rectified by changing the properties which comes in the menubar of your command prompt. Then increasing the virtual memory over there. I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • Exception in thread "main" java.lang.OutOfMemoryError( while importing xml)

    I am trying to config application in Sun One Portal server 3.0 SP5 , (Sun Solaris 8)during configuration I was trying to import some xml files however during the process I got the error :
    Exception in thread "main" java.lang.OutOfMemoryError.
    I tried increasing the size of the heap in jvm12.conf to 512 MB and even tried to run the command -Xms512M, but this didn't help.
    Pls respond as asap.
    Sharad gehani

    Hi gimbal2,
    yeah, its streaming the particular data (ie CUSTOMER) from input xml file and generate the txt file.
    I tried like below . But this is also not working. Getting the same error.
    java -Xmx2048m -mx2048m -Xss1024k -Xoss1024m
    Any other possible solution on this?

  • Exception in thread "main" java.lang.OutOfMemoryError(please help me )

    Hi All
    here my java class trying to read a txt file(which is having size of 60MB).and putting each line into a Vector class. problem is ,upto certain number of line it is reading properly and putting into vector..after that it is giving error like Exception in thread "main" java.lang.OutOfMemoryError..what is the problem and how to rectify this one..anybody help me on this.
    actual situation is one txt is there in that 80 lakhs of lines of content is there..java file trying to read each line and put it into vector or stringbuffer and split it into two lines like key=value and put it into hashmap object.then finally iam creating new file(.properties) and writing these hashmap data on it. if you want clearly..please look into below code..
    package test.utf8; import java.io.*; import java.util.*; public class AssetUtils
    //static StringBuffer stringbuffer = new StringBuffer();
    public AssetUtils()
    public static void main(String args[]) throws IOException
    BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream("D:\\list.txt")));
    Vector vector = new Vector(0x30D40, 50000);
    System.out.println(vector.capacity());
    Object obj = null;
    int n=0;
    System.out.println("Reading list:" + new Date(System.currentTimeMillis()));
    do
    String s = bufferedreader.readLine();
    //System.out.println("line no: "+ ++n);
    if(s == null)
    break;
    vector.add(s);
    } while(true);
    System.out.println("List Read complete:" + new Date(System.currentTimeMillis()));
    String s1 = args[0];
    System.out.println("S1: "+s1);
    System.out.println(vector.capacity());
    HashMap hashmap = new HashMap();
    System.out.println( "Vector.Size..>>>>>>>>>>>>>>>>.."+vector.size());
    for(int i = 0; i < vector.size(); i++)
    System.out.println("i value:"+i);
    String s2 = (String)vector.get(i);
    //System.out.println("S2: "+s2);
    if(s2.indexOf("/") != -1)
    String s3 = s2.substring(s1.length(), s2.length());
    //System.out.println("S3: "+s3);
    if(s3.indexOf("/") != -1) {
    String s4 = s3.substring(0, s3.lastIndexOf("/"));
    //System.out.println("S4: "+s4);
    String s6 = s3.substring(s3.lastIndexOf("/") + 1, s3.length());
    //System.out.println("S6: "+s6);
    StringBuffer stringbuffer=null;
    stringbuffer = new StringBuffer();
    String s8 = (String)hashmap.get(s4);
    //System.out.println("S8: "+s8);
    if(s8 != null) stringbuffer.append(s8 + "," + s6);
    else
    stringbuffer.append(s6);
    hashmap.put(s4, stringbuffer.toString());
    //stringbuffer.delete(0,stringbuffer.length());
    stringbuffer=null;
    System.out.println("Opening asset.properties:" + new Date(System.currentTimeMillis()));
    File file = new File("D:\\asset.properties");
    PrintWriter printwriter = new PrintWriter(new FileOutputStream(file));
    String s5;
    String s7;
    for(Iterator iterator = hashmap.keySet().iterator(); iterator.hasNext(); printwriter.println(s5 + "=" + s7))
    { s5 = (String)iterator.next(); s7 = (String)hashmap.get(s5); } printwriter.close();
    System.out.println("Closing asset.properties:" + new Date(System.currentTimeMillis()));

    Theres a number of ways you can improve your memory usage:
    1) Build you map as you read in your file.
    2) Use StringBuffers in your map - do not use "asshaj" + "ashaskj" This is very memory intensive
    If you still run out of memory try running the JVM using -Xms128m -Xmx512m or higher

  • FB 4.7 iOS packaging - Exception in thread "main" java.lang.OutOfMemoryError"

    I have been having issues with FlashBuilder 4.7 and packaging my Flex Mobile application for iOS (simulator, or for install on device).
    The funny thing is it used to work just fine before a OSX system update.
    My machine is Macbook Pro, 2.66 GHz i7, Mac OSX Lion 10.7.5, 8GB
    When I run application to install on device I get the error...
    Error occurred while packaging the application:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
              at com.adobe.png.PNGReader.readChunk(PNGReader.java:60)
              at com.adobe.png.PNGUtils.updatePNGMetadata(PNGUtils.java:56)
              at com.adobe.air.ipa.IPAOutputStream.addFile(IPAOutputStream.java:700)
              at com.adobe.air.ADTOutputStream.addFileFromStream(ADTOutputStream.java:307)
              at com.adobe.air.ADTOutputStream.addFileFromStream(ADTOutputStream.java:300)
              at com.adobe.air.ipa.IPAOutputStream.addSpecialIcon(IPAOutputStream.java:272)
              at com.adobe.air.ipa.IPAOutputStream.addFile(IPAOutputStream.java:256)
              at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:72)
              at com.adobe.air.ipa.IPAPackager.createPackage(IPAPackager.java:245)
              at com.adobe.air.ADT.parseArgsAndGo(ADT.java:571)
              at com.adobe.air.ADT.run(ADT.java:419)
              at com.adobe.air.ADT.main(ADT.java:469)
    I have tried uninstalling/ reinstalling Flash Builder 4.7 multiple times
    I get this error no matter which AIR SDK I am using, 3.1, 3.4, 3.5, 3.6.
    I get this error with a blank fresh project.
    Please anyone, can you help me solve this.

    I solved this. It turns out the app icons were corrupt. After removing them and replacing them with new files this error went away.

  • Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

    i have a huge XML file of size 9 MB. I need to parse it and store it in a MYSQL database. When i execute the program, it throws me out of memory error and only 12668 rows have been inserted into the database. I use SAX parser to parse the XML. i have also given the stack trace of the error below. Kindly let me know how to resolve the issue.
    I have also changed the JAVA_OPTS to -Xms128m -Xmx512m but this didnt solve the issue.
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
    at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
    at java.util.jar.Manifest.read(Unknown Source)
    at java.util.jar.Manifest.<init>(Unknown Source)
    at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
    at java.util.jar.JarFile.getManifest(Unknown Source)
    at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:430)
    at com.mysql.jdbc.PreparedStatement.getInstance(PreparedStatement.java:561)
    at com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1395)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4178)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4077)
    at DBManager.insertSchedules(DBManager.java:30)
    at EPGParser.startElement(EPGParser.java:71)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

    Check your code where u set the connection query; there's a procedure in my DBConnection class, looks like this:
         public void setQuery(String query) throws SQLException {          
              this.query = conn.prepareStatement(query);
    Should look the same for u, at least similar.
    I set the query this way: dbConn.setQuery("insert into groups (id, code, sectionID, languageID, year, no_students) values (?,?,?,?,?,?)");
    I had to insert 24,827 records into a table, and it throws the heap space exception u mentioned when it reaches 12,667. So what i did was to put dbConn.setQuery(...) outside the loop, and inside the loop it remains to set the parameters and execute the query from connection. It works for me. Hope will help u save some memory space.

  • Error of compilation for IOS: Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

    Error of compilation for an IOS project:
    Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
    at adobe.abc.Algorithms$SetMap.get(Algorithms.java:226)
    at adobe.abc.Algorithms$ExprWorkQueue.add(Algorithms.java:491)
    at adobe.abc.Algorithms$ExprWorkQueue.addAll(Algorithms.java:524)
    at adobe.abc.GlobalOptimizer.sccp_analyze(GlobalOptimizer.java:6007)
    at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4733)
    at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3615)
    at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2309)
    at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:534)
    at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:343)
    at com.adobe.air.ipa.GOAOTCompiler.convertAbcToLlvmBitcodeImpl(GOAOTCompiler.java:243)
    at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:85)
    Compilation failed while executing : ADT
    We allocate 4GB of memory for the compilator and the results is the same. The build is very long (~5 min)

    See if this helps
    OutOfMemoryError: GC overhead limit exceeded when heap is just fine
    regards
    Pravin

  • How do I stop "Exception in thread "main" java.lang.OutOfMemoryError.java heap space

    I'm trying to rebuild my iPhone app, with hires graphics etc, using CS6 Flash Pro. However, I get this now,
    Exception in thread "main" java.lang.OutOfMemoryError.java heap space .....  followed by a lot of location information related to the error.
    Now, how do I increase the java memory allowances if that's the problem. I've already upp the jvm.ini file from 128 to 512. No difference.
    I'm based on
    Win8, 8GB RAM, x64
    I'm obviously asking it to load a lot of resources - but hey, Flahs should be able to handle it right?
    thanks if anyone can help

    Hmmm. Maybe I was doing something wrong with images, and icons. I'm not sure, as it's not at all clear really.
    This is the Icons screen from CS6, can't see the files above 512x512unless scrolling up - 29x29,57x57,114x114.  no matter.
    So - after reading and rereading the Apple specs and directions, I removed the 512x512 and the 1024x1024 images from the Icons list that get pulled in during build.
    Next, I again re-read the Apple directives, and put the required files for the build into the base directory of the build, as per this image.
    In actual fact - I can probably leave out the last two. iTunesArtwork.xxx But I don't know, because it is entirely unclear on that point. I can find no directive regarding this at all.
    Do I upload them myself? Probably? I don't know.
    HOWEVER.
    The build now completes. Java, or something, was very confused about finding that file called 1024x1024.png in the build list, and would not do it.
    Take it out of icons, built fine. Put it in the icons directory, and crash...
    Now - with the setup I am using, it all builds fine for ipad and iphone, in all resolutions.
    I don't know what the problem is with what Java is seeing, but this fixes it it seems.
    Hope that helps anyone else.
    cheers

  • Keytool throwing  Exception in thread "main" java.lang.OutOfMemoryError:

    Hello all.
    I am unable to run keytool as it throws the following error. I am running Vista(x86),JDK 1.6 with a system with 4G of ram.
    Any idea's how i would solve this? I have tried installing other JDK's with the same results.
    Thanks in advance.
    C:\Users\Gav>"c:\Program Files\Java\jdk1.6.0_07\bin"\keytool -genkey -alias andr
    oiddebugkey -keyalg RSA -validity 365 -keypass android -keystore debug.keystore
    -storepass android
    What is your first and last name?
      [Unknown]:  a
    What is the name of your organizational unit?
      [Unknown]:  b
    What is the name of your organization?
      [Unknown]:  c
    What is the name of your City or Locality?
      [Unknown]:  d
    What is the name of your State or Province?
      [Unknown]:  e
    What is the two-letter country code for this unit?
      [Unknown]:  fs
    Is CN=a, OU=b, O=c, L=d, ST=e, C=fs correct?
      [no]:  yes
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
            at java.io.WinNTFileSystem.list(Native Method)
            at java.io.File.list(File.java:973)
            at sun.security.provider.SeedGenerator$1.run(SeedGenerator.java:166)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.security.provider.SeedGenerator.getSystemEntropy(SeedGenerator.java:146)
            at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:170)
            at java.security.SecureRandom.nextBytes(SecureRandom.java:433)
            at java.math.BigInteger.randomBits(BigInteger.java:475)
            at java.math.BigInteger.<init>(BigInteger.java:464)
            at java.math.BigInteger.largePrime(BigInteger.java:596)
            at java.math.BigInteger.probablePrime(BigInteger.java:538)
            at sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:105)
            at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:656)
            at sun.security.x509.CertAndKeyGen.generate(CertAndKeyGen.java:131)
            at sun.security.tools.KeyTool.doGenKeyPair(KeyTool.java:1156)
            at sun.security.tools.KeyTool.doCommands(KeyTool.java:786)
            at sun.security.tools.KeyTool.run(KeyTool.java:172)
            at sun.security.tools.KeyTool.main(KeyTool.java:166)

    See http://bugs.sun.com/bugdatabase/view_bug.do;?bug_id=6474350
    It seems that one way used by SecureRandom to gather entropy is to scan the directory pointed at by java.io.tmpdir. If it is very full, it runs out of memory. Clean you Local Settings\Temp directory.

  • Incorrect XPath:,Exception in thread "main" java.lang.OutOfMemoryError:

    Hi All,
    We are having a Java Concurrent Program with Output as "Text" format.
    We are encountered with the below error.
    Can anyone help me on this..
    Incorrect XPath: (((not(CF_SO_LINK!=''))or CF_ITEM_TYPE='SATO' or(CF_ITEM_TYPE='ATO' and CF_ITM_TP_CD!='CONFIG')or (not(CF_ATO_LINE_ID!='')and CF_TOP_MDL_ID!='' and(CSHIP='Y' or CINV='Y'))or CF_ITEM_TYPE='EXT_WRT')an d CF_FLOW_ST_CD!='CANCELLED')or SALES_LINE_ID='' Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:3209) at java.lang.String.<init>(String.java:216) at java.lang.StringBuffer.toString(StringBuffer.java:585) at oracle.apps.xdo.batch.BurstingProcessorEngine.applyGroupBreak(BurstingProcessorEngine.java:2315) at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement(BurstingProcessorEngine.java:1983) at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1135) at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest(BurstingProcessorEngine.java:2177) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingEndElement(BurstingProcessorEngine.java:1809) at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement(BurstingProcessorEngine.java:1138) at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201) at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingConfigParser(BurstingProcessorEngine.java:979) at oracle.apps.xdo.batch.BurstingProcessorEngine.process(BurstingProcessorEngine.java:913) at oracle.apps.xdo.batch.DocumentProcessor.process(DocumentProcessor.java:214) at
    Thanks
    gt1982

    i m getting Exception in thread "main"
    java.lang.OutOfMemoryError,
    please help meHow?
    You are leaking memory or attempting to use to much. There is a bug in your code.

  • Exception in thread "DoSManager" java.lang.OutOfMemoryError: nativeGetNewTLA

    Hi,
    We are facing this 'Exception in thread "DoSManager" java.lang.OutOfMemoryError: nativeGetNewTLA' exception in our production logs. Our JVM as part of WebLogic Server is BEA JRockit(R) Version R27.6.5-32_o-121899-1.6.0_14 and linux-x86_64.
    This is how our JVM is configured:
    a. Stack size(-Xss)
    --This is not configured
    b. Heap size
    ---Xms2048m -Xmx2048m
    c. XXtlasize
    ---This is not configured
    d. XXlargeobjectlimit
    ---This is not configured too
    As I understand if we don't configure above parameters then default values will be considered. Our concern is whenever this exception occurs our application crashes obviously because JVM is not able to execute the code because of insufficient memory. Do we need to tune our JVM or do we need to fix issues in our code? My next task is actually to do the Heap Dump analysis on the Production heap dump which would have been taken when there is an 'OutOfMemoryError' outage for better analysis. For heap dump analysis we will be using MAT.  
    Any suggestions regarding this would be welcomed.

    i m getting Exception in thread "main"
    java.lang.OutOfMemoryError,
    please help meHow?
    You are leaking memory or attempting to use to much. There is a bug in your code.

  • Exception in thread "main" java.lang.NoClassDefFoundError

    Am using java 1.3.1 on Red Hat Linux 7.1
    i get this error
    Exception in thread "main" java.lang.NoClassDefFoundError
    while running a simple program HelloWorld.java
    help

    When you use the "java" command, the only required argument is the name of the class that you want to execute. This argument must be a class name, not a file name, and class names are case sensitive. For example, "java HelloWorld.java" won't work because the class name isn't HelloWorld.java, it's HelloWorld. Similarly, "java helloworld" won't work because a class defined as "public class HelloWorld {" is not named helloworld due to case sensitivity. Finally, the .class file must be in a directory that is in the Classpath - that's where java.exe searches to find the file that contains the class.

  • HELP Needed with this error:   Exception in thread "main" java.lang.NoClass

    Folks,
    I am having a problem connecting to my MSDE SQL 2000 DB on a WindowsXP pro. environment. I am learning Java and writing a small test prgm to connect the the database. The code compiles ok, but when I try to execute it i keep getting this error:
    "Exception in thread "main" java.lang.NoClassDefFoundError: Test1"
    I am using the Microsoft jdbc driver and my CLASSPATH is setup correctly, I've also noticed that several people have complained about this error, but have not seen any solutions....can someone help ?
    Here is the one of the test programs that I am using:
    import java.sql.*;
    * Microsoft SQL Server JDBC test program
    public class Test1 {
    public Test1() throws Exception {
    // Get connection
    DriverManager.registerDriver(new
    com.microsoft.jdbc.sqlserver.SQLServerDriver());
    Connection connection = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://LAPTOP01:1433","sa","sqladmin");
    if (connection != null) {
    System.out.println();
    System.out.println("Successfully connected");
    System.out.println();
    // Meta data
    DatabaseMetaData meta = connection.getMetaData();
    System.out.println("\nDriver Information");
    System.out.println("Driver Name: "
    + meta.getDriverName());
    System.out.println("Driver Version: "
    + meta.getDriverVersion());
    System.out.println("\nDatabase Information ");
    System.out.println("Database Name: "
    + meta.getDatabaseProductName());
    System.out.println("Database Version: "+
    meta.getDatabaseProductVersion());
    } // Test
    public static void main (String args[]) throws Exception {
    Test1 test = new Test1();

    I want to say that there was nothing wrong
    with my classpath config., I am still not sure why
    that didn't work, there is what I did to resolved
    this issue.You can say that all you like but if you are getting NoClassDefFound errors, that's because the class associated with the error is not in your classpath.
    (For future reference: you will find it easier to solve problems if you assume that the problem is your fault, instead of trying to blame something else. It almost always is your fault -- at least that's been my experience.)
    1. I had to set my DB connection protocol to TCP/IP
    (this was not the default), this was done by running
    the
    file "svrnetcn.exe" and then in the SQL Server Network
    Utility window, enable TCP/IP and set the port to
    1433.Irrelevant to the classpath problem.
    2. I then copied all three of the Microsoft JDBC
    driver files to the ..\jre\lib\ext dir of my jdk
    installed dir.The classpath always includes all jar files in this directory. That's why doing that fixed your problem. My bet is that you didn't have the jar file containing the driver in your classpath before, you just had the directory containing that jar file.
    3. Updated my OS path to located these files
    and....BINGO! (that simple)Unnecessary for solving classpath problems.
    4. Took a crash course on JDBC & basic Java and now I
    have created my database, all tables, scripts,
    stored procedures and can read/write and do all kinds
    of neat stuff.All's well that ends well. After a few months you'll wonder what all the fuss was about.

  • Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.dr

    Hi
    I am trying to use type 4 driver to connect to my Oracle 9i Rel2 database. I downloaded the odbc14.jar from oracle and added in the C:\Oracle9i\jdbc\lib path. As on the website, I setup my environment:
    Setting Up Your Environment
    On Win95/Win98/NT:
    - Add [ORACLE_HOME]\jdbc\lib\classes111.zip and
    [ORACLE_HOME]\jdbc\lib\nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x or 1.3 is
    used. Add ojdbc14.jar and nls_charset12.zip if JDK 1.4 is used.)
    - Make sure [ORACLE_HOME]\bin is in your PATH.
    Still I am getting the following error during runtime:
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at jdbc.InsertQueryEx.main(InsertQueryEx.java:11)
    Below is the source code:
    import java.sql.*;
    import java.io.*;
    public class InsertQueryEx {
    public static void main(String[] args)throws Exception{
    Class.forName("oracle.jdbc.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@Prashy:1521:orcl", "scott", "tiger");
    DataInputStream din = new DataInputStream(System.in);
    Statement stmt = con.createStatement();
    while(true){
    try{
    System.out.println("enter emp name");
    String name = din.readLine();
    System.out.println("enter emp no");
    int no = Integer.parseInt(din.readLine());
    System.out.println("enter emp salary");
    float sal = Float.parseFloat(din.readLine());
    System.out.println("enter emp address");
    String addr = din.readLine();
    int count = stmt.executeUpdate("insert into myemp values("+no+",'"+name+"',"+sal+",'"+addr+"')");
    if(count>0)
    System.out.println("Record added");
    else
    System.out.println("Failed");
    catch (Exception e){
    System.err.println("Exception: "+e.getMessage());
    Any help is appreciated
    Thanks
    Prashant

    I am sorry but I did add those in the classpath but still getting this error:
    This is what I have for user variable in classpath:
    .;C:\Oracle9i\jdbc\lib\ojdbc14.jar;C:\Oracle9i\jdbc\lib\nls_charset12.jar
    error is:
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at jdbc.InsertQueryEx.main(InsertQueryEx.java:14)
    Thanks

Maybe you are looking for