java.lang.OutOfMemoryError

M

mamin

Help!!!
I create two threads.
wysylka w1 = new wysylka();
new Thread(w1).start();

wysylka w2 = new wysylka();
new Thread(w2).start();

In every one I'm executing a query to database.As a result of that query a
have 700000 rows in ResultSet. While executing a query the
java.lang.OutOfMemoryError
appears.Anyone have idea what to do with it?
 
F

Flop Meister

mamin said:
Help!!!
I create two threads.
wysylka w1 = new wysylka();
new Thread(w1).start();

wysylka w2 = new wysylka();
new Thread(w2).start();

In every one I'm executing a query to database.As a result of that query a
have 700000 rows in ResultSet. While executing a query the
java.lang.OutOfMemoryError
appears.Anyone have idea what to do with it?

The following command line parameters might help, by increasing the maximum
heap size. These are for the Sun JDK version of java.exe on Windows, but
the documentation indicates they are also available for Linux and Solaris.

-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size

Also, think about your application. Can you break down the query into
multiple queries that return less data? Are there data integrity issues
that prevent this?
 
R

Richard Chrenko

The following command line parameters might help, by increasing the
maximum heap size. These are for the Sun JDK version of java.exe on
Windows, but the documentation indicates they are also available for
Linux and Solaris.

-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size

Careful if you will be distributing your application. The documentation
states that -X command line arguments are 'unsupported' and may change or
disappear in future Java versions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top