Connecting through java to HSQLDB: Out of Memory

Through my java program i am connecting to hsqldb which has .data file of approx 6.5 GB and getting the error java.sql.SqlException: out of memory (am not getting anything else)
have increased jvm option -Xms256m -Xmx1024m -XX:PermSize=64M -XX:MaxPermSize=2000M
What else can be tried...??? A complete Stacktrace for the same
exception in thread HSQL timer
java.lang.OutofMemoryError: Java Heap Space
Besides that also got this on netbeans console but seems this is something else... and not an error
Mar 19, 2009 4:55:36 AM sun.awt.X11.XToolkit processException
WARNING: Exception on Toolkit thread
java.lang.OutOfMemoryError: Java heap space
Edited by: shubham on Mar 19, 2009 1:57 AM
Edited by: shubham on Mar 19, 2009 3:31 AM

Well The issue was somewhere else due to it reading too much of data. It ran but my program is very slow (approx 2-3 hrs).
I am worried about the speed...
is it because of the large amount of data.. 23,355,459 records..?? or there could be some issue in programming probably memory leak etc..??
-> reads db
-> for each record set
-> perform different operation/ writes to file

Similar Messages

  • Problem with socket connection through Java Embedding...

    We are trying to create a simple socket connection to a socket server through BPEL PM using the Java Embedding component.
    BPEL Process : Client makes an asynchronous request. Passes an input variable. The input variable is sent to the Server Program through a socket connection through the Java embedding component.
    Server: We are running a simple Socket Server program from command prompt.
    The code below works fine as long as we do not try to receive a response from the server (Commented Code).
    If we uncomment the code and try to receive a response, it refuses to create an instance for the BPEL Process. And sometimes restarts the BPEL Server.
    Client Code:
    String msg="NONE";
    try{
    org.w3c.dom.Element input = (org.w3c.dom.Element) getVariableData("inputVariable","payload","/client:clientProcessRequest/client:input");
    msg = input.getNodeValue();
    Socket clientsoc=new Socket("ServerIP",1000);
    PrintWriter out1=new PrintWriter(clientsoc.getOutputStream());
    out1.write(msg);
    out1.flush();
    BufferedReader cin1=new BufferedReader(new InputStreamReader(clientsoc.getInputStream()));
    msg=cin1.readLine();
    setVariableData("outputVariable","payload","/client:result",new String(msg));
    clientsoc.close();
    catch(UnknownHostException e)
    System.err.println("Don't know about host: dev.");
    System.exit(1);
    catch (IOException e)
    System.err.println("Couldn't get I/O for "+ "the connection to: dev.");
    System.exit(1);
    }

    Repost

  • Mass processing - Error when processing Java programs / VMC out of memory

    When running a mass update background process that updates the status of a service order in CRM the job fails due to error 'Error when processing Java programs'. I checked the VMC (SM52) and noticed that there is an error about the VMC running out of memory.
    The background program can either be a PPF Action or a Z-ABAP program that performs the update. Both programs are performing a CRM_ORDER_INITIALIZE but it seems that the VMC is not releasing the memory fast enough.
    Is there anyway we can force the VMC to release the memory after processing of each individual order?
    Thanks!

    I got  similar issue and it got resolved by useing CRM_ORDER_INITILAIZE. Initalization should happen after every Order processing and see that only one header guid is passed to the the FM. May not be good option ,but just try by putting wait for 5secs after CRM_ORDER_INITILAIZE.

  • FTP Connection Through JAVA

    I am writing a java code to transfer a file from local machine to a server on another machine.
    While uploading i am encountering with an exception which is showing as
    java.net.ConnectException: Connection refused: connect
    The file is getting transferred sucessfully if i am transferring it through command prompt instead of java code.
    Please help me out.

    Duplicated here
    http://forum.java.sun.com/thread.jspa?threadID=700335&messageID=4063726#4063726
    and here
    http://forum.java.sun.com/thread.jspa?threadID=700257&messageID=4063471#4063471

  • RFC connectivity through JAVA

    Hello sir,
    I have create 1 java class file which connects to SAP DB through RFC connection.
    I have put sapjco3.dll,librfc32.dll,sapjcorfc.dll in to the folder windows\system32.
    Its working fine on windowsXP, but not working on Windows Vista and windows server 2003.
    its giving error as
    java.lang.UnsatisfiedLinkError: D:\splerp3\sapjco3.dll: The application has failed to start because
    its side-by-side configuration is incorrect.
    please tell me what configuration i have to do for vista and server 2003.

    Hi guys,
    please pay attention to the given infos on the JCo download site. It says:
    Note: Starting with JCo 2.1.4 and JCo 2.0.11, JCo requires the Visual Studio .NET C/C++ runtime libraries on Windows platforms.
    Starting with JCo 3.0.0, it requires the Visual Studio 2005 C/C++ runtime libraries. See SAP note [684106|https://service.sap.com/sap/support/notes/684106] for details on how to install them.
    Installing the VC redistributable packages from Microsoft will solve this issue.
    Regards,
    Stefan

  • Oracle 7.x connection through Java application.

    I have Win98 and Oracle 7.x on my P.C., I am developing an application in Java Menus where under one menu one can get a connection with the underlying Oracle DB. But even after proper JDBC coding I am not able to get the connection. Please help.
    Thnaks,
    Pushpahas.

    Can u be more pecific on the error u r getting may be that way i can help u..
    shravan

  • Mainframe connection through java

    Hi,
    Is it possible to connect to a mainframe and retrieve the results from it i.e., the data stored are in the form of cards(record types).Is it possible to connect to such set up using JDBC connectivity as we do for the normal RDBMS connection..
    Kindly help me in this regards
    Wiht thanks in advance
    subra

    Why on earth should a "mainframe" (you even didn't tell us which OS) be such a magic zone that even Java can't enter it?
    How do other programming languages manage to connnect to a DBMS on a mainframe?
    How has for example Oracle succeeded to be used on mainframes?
    I think you should ask your DBMS' vendor at first.
    "Mainframe" is a collective name for certain hardware structures only.

  • Out of memory error for large recordings:

    Hi,
      My workflow process takes input as a list. It loops through the workflow for all the items in the list. If my list contain 4 items, there will be 3*7= 21 steps when I invoke the process. I can able to check my recordings for debugging.
    If I give 5 inputs, It takes around 5*7 = 35 steps in the workflow. If I try to play the recording, i see the error: java heap space: Out of memory exception. I changed my space to Xmx1024m in workbench.ini. I also did: java -Xms<initial heap size> -Xmx<maximum heap size> (Q1: do we need to restart the JBoss after we do the second step? ).
    Q2: My system is Windows7 with 4GB RAM. I have liveCycle 8.2 with SP2. JBoss & MySql. Do I need to set this java RAM size in any of our JBoss server files?
    Q3: Is there any file to set the maximum permissible steps for a process recording? If so, please let me know. It would be a great help.
    Thanks,
    Chaitanya

    If the size of the documents you are adding as input are very large this could result in OOM errors so that is something to consider. 
    Some other things to try are as follows:
    1. Increase memory allocated by JBoss by another 200 - 300 M as per the following documentation on the web:
    http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.html?topic=000097&topic=00183 7
    2. Read the following sections of the Workbench Help which can be found on the web and describes how to limit your recording storage space used:  http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.html?topic=000097&topic=00106 0
    I would suggest increasing your maxNumberOfRecordingEntries to about 200.
    Heather

  • Out of memory Error in J2me

    Hi,
    I'm compiling many form in one J2me (java) class through the commandAction interface Out of memory Error occured . Could anyBody help me, to eliminate this Error
    Thanks in advance plz help me.....
    Mahesh@sun

    Solution: conserve memory...
    Find out what is eating all your memory, and then find a way to use less..

  • Out of memory errors

    I'm having problems starting 8i. When started from /etc/rc.d/
    init.d/dbora during bootup or manually by root, I get an out of
    memory error.
    If I start it from the dbadmin user (oracle), I either get the
    same out of memory error, or I end up with several hundred shell
    logins and the database still doesn't respond.
    This is RedHat Linux 6.0, kernel 2.2.5-22smp. Here is a sample of
    what happens when I get the out of memory error:
    Mem: 160448K av, 53488K used, 106960K free, 26264K shrd,
    6532K buff
    Swap: 656360K av, 0K used, 656360K free
    36328K cached
    Oracle Server Manager Release 3.1.5.0.0 - Production
    (c) Copyright 1997, Oracle Corporation. All Rights Reserved.
    Oracle8i Release 8.1.5.0.0 - Production
    With the Java option
    PL/SQL Release 8.1.5.0.0 - Production
    SVRMGR> Connected.
    SVRMGR> ORA-27102: out of memory
    Linux Error: 22: Invalid argument
    SVRMGR>
    Server Manager complete.
    Database "ORCL" warm started.
    null

    It turns out that the problem I was having with a large number of
    shell processes being created was due to the use of oraenv in my
    .bashrc file (so much for following the instructions!) It was
    calling itself recursively until the process limit was reached.
    However, even with this fixed, the out of memory error still
    exists.
    max (guest) wrote:
    : dan....
    : check your init.ora......
    Aside from comments, it has these lines, which were created by
    dbassist:
    db_name = test
    instance_name = ORCL
    service_names = test
    control_files = ("/u02/oradata/test/control01.ctl", "/u02/oradata/
    test/control02.ctl")
    db_block_buffers = 8192
    shared_pool_size = 4194304
    log_checkpoint_interval = 10000
    log_checkpoint_timeout = 1800
    # I reduced processes to see if it would help
    processes = 10
    log_buffer = 163840
    background_dump_dest = /u01/admin/test/bdump
    core_dump_dest = /u01/admin/test/cdump
    user_dump_dest = /u01/admin/test/udump
    db_block_size = 2048
    remote_login_passwordfile = exclusive
    os_authent_prefix = ""
    compatible = "8.1.0"
    : also check ulimit
    Here's ulimit -a:
    core file size (blocks) 1000000
    data seg size (kbytes) unlimited
    file size (blocks) unlimited
    max memory size (kbytes) unlimited
    stack size (kbytes) 8192
    cpu time (seconds) unlimited
    max user processes 256
    pipe size (512 bytes) 8
    open files 1024
    virtual memory (kbytes) 2105343
    Everything looks pretty large to me.
    : Dan Wilga (guest) wrote:
    : : I'm having problems starting 8i. When started from /etc/rc.d/
    : : init.d/dbora during bootup or manually by root, I get an out
    : of
    : : memory error.
    : : If I start it from the dbadmin user (oracle), I either get
    the
    : : same out of memory error, or I end up with several hundred
    : shell
    : : logins and the database still doesn't respond.
    : : This is RedHat Linux 6.0, kernel 2.2.5-22smp. Here is a
    sample
    : of
    : : what happens when I get the out of memory error:
    : : Mem: 160448K av, 53488K used, 106960K free, 26264K shrd,
    : : 6532K buff
    : : Swap: 656360K av, 0K used, 656360K free
    : : 36328K cached
    : : Oracle Server Manager Release 3.1.5.0.0 - Production
    : : (c) Copyright 1997, Oracle Corporation. All Rights Reserved.
    : : Oracle8i Release 8.1.5.0.0 - Production
    : : With the Java option
    : : PL/SQL Release 8.1.5.0.0 - Production
    : : SVRMGR> Connected.
    : : SVRMGR> ORA-27102: out of memory
    : : Linux Error: 22: Invalid argument
    : : SVRMGR>
    : : Server Manager complete.
    : : Database "ORCL" warm started.
    null

  • Getting result from a telnet command through Java

    Hi,
    I've been using a set of classes found here: http://javatelnet.org/
    to do telnet through Java in a non-interactive mode.
    However I've got a problem when retrieving the result of a command sent to the remote host: the classes read the stream until the prompt is encountered; my problem is I must execute commands on several remote hosts, and the prompt is not necessarily the same on all hosts.
    Is there a simple means to establish a telnet connection through Java and retrieve the result of the commands?
    Any help would be appreciated.

    Thanks again, this is a very good article
    I see it is still the same strategy to get the result of a command : wait 'til the prompt is sent. Maybe there is just no other way to get it .
    But as I don't know the prompt on the different hosts I have to query, this won't do it.
    The article gave me an idea though : I only need to count the files in a directory on the remote host; until now I was trying to send the 'ls | wc -l' command by Telnet.
    Maybe I can simply do it by FTP (retrieve the list of files, and then count the lines with JAVA).

  • Displaying images - out of memory  (was Loading imagens - out of memory")

    Well guys,
    this is REALLY an intriguing issue. Ok, the subject of the post was not precise; I do not want to load the images. I just want to display them, in batches, one batch at a time. My applet loads the last batch of images available and displays them like a "mosaic". After a cycle (a batch of images) I set the image descriptors (an array of them) to null and explicitly call the garbage collector.
    I made some tests varying the number of times I call System.gc() with no effective results: "Out of memory" in java console always happens, sooner or later.
    I've also tried to limit cache size in control panel "java plug-in". This seems to be a nonsense recommendation I�ve seen in the Internet. The memory growing process is IE, not JVM.
    Also tried to disable caching with <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> clause in the page that contains the applet. No results at all.
    Despite of all my efforts trying to limit my "memory voracious" applet, task manager reports an unlimited growing memory for IE and, after some time, the applet locks, with java console reporting "out of memory".
    I have found no effective recommendations/solutions in the Internet.. Only speculations.
    The question is simple (I do not expect a simple answer :-)) : how do I limit IE memory consumption?
    Any help will be appreciated.
    l.a.

    Actually, i have the same problem...
    Im using an applet that generates me a Chart.
    Each time i generate a Chart, IE's memory goes up like 10mb and the applets fails running when it reaches about 130MB
    the odd thing is, is that even when i RELOAD the page, the memory does not go down... its as if the applet was never unloading no matter what you do, except reseting IE...

  • Download Servlet throwing Out Of Memory Exception

    I am trying to download file of more than 500 mb through servlet but getting out of memory exception .
    Before downloading i am zipping that huge file .
    try {
         String zipFileName = doZip(file);
          file =null;
          System.gc();
          File inputFile = new File(zipFileName);
          InputStream fileToDownload = new FileInputStream(
                                            inputFile);
           response.setContentType("application/zip");
         response.setHeader("Content-Disposition","attachment; filename=\""
                                                      + fileName.replaceAll("tmx", "zip")
                                                                .concat("\""));
         response.setContentLength(fileToDownload.available());
         byte buf[] = new byte[BUF_SIZE];
         int read;
         while ((read = fileToDownload.read(buf)) != -1) {
                   outs.write(buf, 0, read);
              fileToDownload.close();
                   outs.flush();
                                  outs.close();
    }catch(Exception e ) {
      //Getting out of memory.
    }Please suggest solution for this .

    cotton.m wrote:
    My zip suggestion was as follows.
    Take the file. Do not set the Content length header. Do set the Content encoding header to gzip. Create a GZIP output stream using the servlet output stream. Read the unzipped file in and output it through the gzip output stream.
    This cuts out one full cycle of file reading and writing from what you are doing currently.Thanks for u r reply
    InputStream fileToDownload = new FileInputStream(
                                            file);
    response.setContentType("application/gzip");
    response.setHeader("Transfer-Encoding", "chunked");
    response.setContentLength((int) file.length());
    GZIPOutputStream gzipoutputstream = new GZIPOutputStream(outs);
    byte buf[] = new byte[BUF_SIZE];
    int read;
    while ((read = fileToDownload.read(buf)) != -1) {
         gzipoutputstream.write(buf, 0, read);
    fileToDownload.close();
    outs.flush();
    outs.close();I made changes accordingly . Please provide u r view on this .

  • Java Out of memory error when accessing MySQL

    Hi all
    I've got a weird problem, I programed some code to mirror data between two databases and I was testing it with two different computers each one running MySQL. The first database has 33,000 rows across 40 columns and the second one 380,000 rows across 40 columns. When trying to transfer the data from the small database to the large one everything works fine, after a couple of minutes all 33,000 rows are successfully transfered to the large one.
    But then I tried it the other way around, transfer 380,000 rows to the small. This does not run at all it just gives me an error of Out Of Memory and stops. I tried on win2k, winxp and redhat 7.3 same error. Does anyone has any idea why this is happening? All three machines have 512MB RAM.
    Is there a limit on the size that a result set can have? I really need to know since this database is gonna grow by aprox. 136,000 rows per hour or 3,264,000 rows per data. That's about 3 GB of data per day which needs to be mirrored across the databases.
    Any suggestions would really be apreciated

    Thanks for the response guys,
    The purpose of this program is to mirror the data between two databases. The first one sits on a machine that is monitoring a system through sensors connected via a DSP card. Now the processing of the gathered data is done on the second machine. This mirroring needs to happen every day and as I said on my previous post the amount of data is aprox. 3GB per day or about 1.2m rows per day. I know this is a huge amount of data.
    In the program I've written what I do is:
    get a connection to both databases on both servers then I create a prepared statement to do the INSERT. Then I get a result set from the first database and in the while loop I update the data to the second one. So only one result set is used. Now I shouild let you know that there's never gonna be any updating of the data only new ones get added.
    I am assuming by the error I get that when I get my result set it tries to load it all in memory which I do not want to do for the obvious reasons.
    I am including my code
    import java.sql.*;
    import java.util.*;
    class Mirror {
        Connection con;
        Statement dispStmt;
        Connection con2;
        PreparedStatement updStmt2;
        public static void main( String args[] ) {
            Mirror mr = new Mirror();
            mr.process();
        public void process() {
            try {
                Class.forName( "org.gjt.mm.mysql.Driver" ).newInstance();
                con2 = DriverManager.getConnection( "jdbc:mysql://ipaddress/database2", "username", "password" );
                updStmt2 = con2.prepareStatement( "insert into Gratings (SensorSetID, Grating_1, Grating_2, Grating_3, Grating_4, Grating_5, Grating_6, Grating_7, Grating_8, Grating_9, Grating_10, Grating_11, Grating_12, Grating_13, Grating_14, Grating_15, Grating_16, Grating_17, Grating_18, Grating_19, Grating_20, Grating_21, Grating_22, Grating_23, Grating_24, Grating_25, Grating_26, Grating_27, Grating_28, Grating_29, Grating_30, Grating_31, Grating_32, Grating_33, Grating_34, Grating_35, Grating_36, Grating_37, Grating_38, Grating_39, Grating_40) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
                con = DriverManager.getConnection( "jdbc:mysql://ipaddress/database1", "usernames", "password" );
                dispStmt = con.createStatement();
            catch( Exception e ) /* (ClassNotFoundException and SQLException)*/ {
                e.printStackTrace();
            try {
                synchronized( this ) {
                    ResultSet rs = dispStmt.executeQuery( "select * from Gratings" );
                    while( rs.next() ) {
                        updStmt2.setString( 1, rs.getString( "SensorSetID" ) );
                        updStmt2.setString( 2, rs.getString( "Grating_1" ) );
                        updStmt2.setString( 3, rs.getString( "Grating_2" ) );
                        updStmt2.setString( 4, rs.getString( "Grating_3" ) );
                        updStmt2.setString( 5, rs.getString( "Grating_4" ) );
                        updStmt2.setString( 6, rs.getString( "Grating_5" ) );
                        updStmt2.setString( 7, rs.getString( "Grating_6" ) );
                        updStmt2.setString( 8, rs.getString( "Grating_7" ) );
                        updStmt2.setString( 9, rs.getString( "Grating_8" ) );
                        updStmt2.setString( 10, rs.getString( "Grating_9" ) );
                        updStmt2.setString( 11, rs.getString( "Grating_10" ) );
                        updStmt2.setString( 12, rs.getString( "Grating_11" ) );
                        updStmt2.setString( 13, rs.getString( "Grating_12" ) );
                        updStmt2.setString( 14, rs.getString( "Grating_13" ) );
                        updStmt2.setString( 15, rs.getString( "Grating_14" ) );
                        updStmt2.setString( 16, rs.getString( "Grating_15" ) );
                        updStmt2.setString( 17, rs.getString( "Grating_16" ) );
                        updStmt2.setString( 18, rs.getString( "Grating_17" ) );
                        updStmt2.setString( 19, rs.getString( "Grating_18" ) );
                        updStmt2.setString( 20, rs.getString( "Grating_19" ) );
                        updStmt2.setString( 21, rs.getString( "Grating_20" ) );
                        updStmt2.setString( 22, rs.getString( "Grating_21" ) );
                        updStmt2.setString( 23, rs.getString( "Grating_22" ) );
                        updStmt2.setString( 24, rs.getString( "Grating_23" ) );
                        updStmt2.setString( 25, rs.getString( "Grating_24" ) );
                        updStmt2.setString( 26, rs.getString( "Grating_25" ) );
                        updStmt2.setString( 27, rs.getString( "Grating_26" ) );
                        updStmt2.setString( 28, rs.getString( "Grating_27" ) );
                        updStmt2.setString( 29, rs.getString( "Grating_28" ) );
                        updStmt2.setString( 30, rs.getString( "Grating_29" ) );
                        updStmt2.setString( 31, rs.getString( "Grating_30" ) );
                        updStmt2.setString( 32, rs.getString( "Grating_31" ) );
                        updStmt2.setString( 33, rs.getString( "Grating_32" ) );
                        updStmt2.setString( 34, rs.getString( "Grating_33" ) );
                        updStmt2.setString( 35, rs.getString( "Grating_34" ) );
                        updStmt2.setString( 36, rs.getString( "Grating_35" ) );
                        updStmt2.setString( 37, rs.getString( "Grating_36" ) );
                        updStmt2.setString( 38, rs.getString( "Grating_37" ) );
                        updStmt2.setString( 39, rs.getString( "Grating_38" ) );
                        updStmt2.setString( 40, rs.getString( "Grating_39" ) );
                        updStmt2.setString( 41, rs.getString( "Grating_40" ) );
                        updStmt2.executeUpdate();
                    rs.close();
                con.close();
                con2.close();
            catch( Exception ex ) {
                System.out.println( ex );
                ex.printStackTrace();
    }Does anyone have any suggestions?
    What can I do in order to prevent the whole database being loaded in memory?
    Additionally I noticed that the above operation stops when memory usage reaches 71.5 MB for the JVM

  • Out of memory error in java- flex communication using RTMP

    We are using flex and java in our application. due to RTMP call to fetch data every 5 seconds. it is hiting database and establishing connection and keeps it open hence this is causing for Out of memory issue. Can come one help on this issue.

    You probably want to ask here: http://forums.adobe.com/community/flex

Maybe you are looking for

  • Preview.app selection dimensions?

    In Tiger (OS X 10.4), when I wanted to crop an image in Preview, I would make a rectangular selection by clicking and dragging. If I held down the Option key while doing so, a little window would appear next to my cursor that displayed the pixel dime

  • Click wheel firewire to usb adapter?

    k I have a older click wheel B&W 15gig iPod with dock connector that says it needs FW for charging. I wold like to use USB if possible, someone recommend this Scosche adapter, can anyone vouch for it? I will be using it in my Honda Civic with my Hond

  • Stack strip chart x axis

    Hi y'all is there a way, besides just putting one strip chart on top of another strip chart and have it aligned just right to hide the x axis and be on the same x scale as the others. For example: Schart #1 represents the pressure in the system, Scha

  • Educess & Hcess Addition in Pricing Proc.

    Hi Guru's I want to Add  : Educess = 2% and Hcess = 1% as two Statistical Condition types in Export Pricing Procedure. The above two conditions will be used for reimbursement process only and will not contribute to total price of the Product. What is

  • Public Site Manager Required to Publish?

    Currently our site is stuck in the pre-approved status. My quess is that it's waiting on categories to be assigned, but will the site need to be converted to the Public Site Manager to be included in the iTunes store?