I never heard about this problem. You probably already know that
"Insufficient system resources exist to complete the requested
service" is from the OS and not from H2, and I guess you have already
done a Google search (just to make sure).
If the problem is the file size, then you could try using the 'split'
file system: http://www.h2database.com/html/advanced.html#file_system
- please tell me if this helps!
Regards,
Thomas
Do you see any problem with keeping all three databases in the same
zip file and reading from there? Also, on average what do you think
will be the performance hit for keeping it all compressed?
Thanks so much for your help.
Yeah, based on the searches I know that it is an OS related problem.
On Dec 17, 6:22 am, Thomas Mueller <thomas.tom.muel...@gmail.com>
wrote:
org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException: File
is read-only"; "zip:C:/SAClient/data/IBMPROD.ExpSA.dbz!/
IBMPROD.ExpSA.h2.db" [90031-125]
How much memory are you making available to the JVM? I've had a
similiar issue, but it turned out that I simply had to make more
memory available to my Java Runtime with the -Xmx parameter. I solved
this by using a small batch file to start the application, it also
creates a neat little console that I use during debugging if I use
java to start the application. I then switch to javaw when I go to
production, hiding the little console.
For example (development code), I put all of this in a batch file
called runner.bat:
@echo off
@cls
@start java -Xmx512m -jar POSClient.jar
Once I'm happy and am deploying on the client side, I change the code
to use the javaw application:
@echo off
@cls
@start javaw -Xmx512m -jar POSClient.jar
This works quite well on Windows machines, of course on my Linux box I
use a little script, but that's mostly for servers and development,
very very few of my clients actually use Linux for workstations.
Best regards
Ewald
> Thanks for the tip about the zip
> I got the test database to work with the zip.
I never wrote anything about "zip". I wrote:
> If the problem is the file size, then you could try using the 'split' file system:
> http://www.h2database.com/html/advanced.html#file_system
Regards,
Thomas
> --
>
> You received this message because you are subscribed to the Google Groups "H2 Database" group.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to h2-database...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
>
>
>
Yes, I do set the java heap size. The problem is not JVM running out
of memory, but rather it seems that there is a slow memory leak from
the JVM to the OS into the nonpaged Kernel and eventually there is not
enough memory left that the database requires during the page loads.
So the machines with smaller Kernel sizes run out before the
connection establishes.
Do you think it would make a difference if I did not run the database
in embedded mode but rather as a local server? Or is the page IO the
same when establishing a connection?
I'm desperately trying to avoid switching databases so I think in the
short term I am going to split the data into smaller databases. The
magic size limit seems to be around 9GB at the moment. In the long run
this will not work as I know the data size will continue to grow.
I have a few questions:
- What is your database URL?
- Did the application run out of memory (once, or multiple times)?
- How did you start the Java process (java -Xmx... and so on)?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- How much heap memory does the Java process have?
- Are there any other exceptions (maybe in the .trace.db file)?
Could you send them please?
- After how long do you usually get this problem?
> Yes, I do set the java heap size. The problem is not JVM running out
> of memory, but rather it seems that there is a slow memory leak from
> the JVM to the OS into the nonpaged Kernel and eventually there is not
> enough memory left that the database requires during the page loads.
> So the machines with smaller Kernel sizes run out before the
> connection establishes.
Could you provide the link where you found this information, except
for the one you aleady sent?
I found this:
http://support.microsoft.com/kb/272568
Possible cause: "Norton AntiVirus"
http://www.coderanch.com/t/381258/Java-General/java/java-io-Exception-Insufficient-system
Possible cause: "UNC Path"
http://support.microsoft.com/kb/259837
Possible cause: "paged pool memory"
> Do you think it would make a difference if I did not run the database
> in embedded mode but rather as a local server? Or is the page IO the
> same when establishing a connection?
Yes, potentially it will help, however I think it should work without
such tricks. H2 doesn't use a lot of resources. Both Java and H2 are
used by many people without problems. I don't think there is a slow
memory leak in the JVM that will show up in your case.
Regards,
Thomas
- First I had everything in one large database - 24GB in size and I
used the standard jdbc:h2:<path> connection
- I split the data into three databases (15GB, 7GB, 3GB). The
computers could establish a connection to the other two but not the
15GB one.
- I switched to using jdbc:h2:zip:
- I switched to using jdbc:h2:split:
- I switched to using jdbc:h2:tcp:
(In all of the above tests the application worked fine on the other
machines but the same five failed with identical error.)
- I split and trimmed the data further (into five databases) so now
the largest database is only 6GB in size and I went back to using
jdbc:h2:split. This is currently the working version now on all the
machines.
> - What is your database URL?
These are the connections I tried:
// connection = DriverManager.getConnection("jdbc:h2:tcp://
localhost/" + path + ";CACHE_SIZE=512000", "sa", "");
// connection = DriverManager.getConnection("jdbc:h2:" + path +
";CACHE_SIZE=512000", "sa", "");
// connection = DriverManager.getConnection("jdbc:h2:zip:" +
path + ";CACHE_SIZE=512000", "sa", "");
connection = DriverManager.getConnection("jdbc:h2:split:" +
path + ";CACHE_SIZE=512000", "sa", "");
> - Did the application run out of memory (once, or multiple times)?
application did not run out of memory. I have code to close the
application when a database connection cannot be established.
> - How did you start the Java process (java -Xmx... and so on)?
from a batch file:
java -Xms256m -Xmx900m -jar EvoClient.jar
> - Is it (or was it at some point) a networked file system?
The laptops are on our corporate network with some mapped drives, but
all the database files were copied onto the local drives.
> - How big is the database (file sizes)?
So far the largest ...h2.db was 24GB. I also know that 15GB was still
too large but that 7GB works.
> - How much heap memory does the Java process have?
Initial allocation is 256MB and maximum is set to 900MB
> - Are there any other exceptions (maybe in the .trace.db file)?
This is the only exception in the trace.db file:
12-10 09:43:46 database: opening C:\SAClient\data\IBMPROD.SA
org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException:
Insufficient system resources exist to complete the requested
service"; "C:\SAClient\data\IBMPROD.SA.h2.db" [90031-124]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.convertIOException(Message.java:329)
at org.h2.store.FileStore.readFully(FileStore.java:286)
at org.h2.store.PageStore.readPage(PageStore.java:969)
at org.h2.store.PageStore.getPage(PageStore.java:490)
at org.h2.store.PageStore.getFreeList(PageStore.java:802)
at org.h2.store.PageStore.allocatePage(PageStore.java:864)
at org.h2.store.PageStore.allocatePage(PageStore.java:856)
at org.h2.index.PageDataLeaf.split(PageDataLeaf.java:352)
at org.h2.index.PageDataNode.addRowTry(PageDataNode.java:153)
at org.h2.index.PageDataNode.addRowTry(PageDataNode.java:145)
at org.h2.index.PageDataIndex.addTry(PageDataIndex.java:149)
at org.h2.index.PageDataIndex.add(PageDataIndex.java:122)
at org.h2.table.TableData.addRow(TableData.java:130)
at org.h2.store.PageStore.redo(PageStore.java:1196)
at org.h2.store.PageLog.recover(PageLog.java:285)
at org.h2.store.PageStore.recover(PageStore.java:1051)
at org.h2.store.PageStore.openExisting(PageStore.java:310)
at org.h2.store.PageStore.open(PageStore.java:268)
at org.h2.engine.Database.getPageStore(Database.java:2305)
at org.h2.engine.Database.open(Database.java:624)
at org.h2.engine.Database.openDatabase(Database.java:227)
at org.h2.engine.Database.<init>(Database.java:221)
at org.h2.engine.Engine.openSession(Engine.java:58)
at org.h2.engine.Engine.openSession(Engine.java:142)
at org.h2.engine.Engine.getSession(Engine.java:122)
at org.h2.engine.SessionFactoryEmbedded.createSession
(SessionFactoryEmbedded.java:17)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer
(SessionRemote.java:245)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:223)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:58)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.sps.sa.services.H2Service.startDB(H2Service.java:49)
at com.sps.sa.services.SADBService.startDB(SADBService.java:53)
at com.sps.sa.db.SADBServiceManager.startDataBases
(SADBServiceManager.java:45)
at com.sps.sa.views.MainFrame.jbInit(MainFrame.java:176)
at com.sps.sa.views.MainFrame.<init>(MainFrame.java:72)
at com.sps.sa.views.MainFrame.<clinit>(MainFrame.java:42)
at com.sps.sa.views.SAClient.<init>(SAClient.java:47)
at com.sps.sa.views.SAClient.main(SAClient.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sps.sa.views.SplashScreen.<init>(SplashScreen.java:64)
at com.sps.sa.views.SplashScreen.main(SplashScreen.java:86)
Caused by: java.io.IOException: Insufficient system resources exist to
complete the requested service
at java.io.RandomAccessFile.readBytes(Native Method)
at java.io.RandomAccessFile.read(Unknown Source)
at java.io.RandomAccessFile.readFully(Unknown Source)
at org.h2.store.FileStore.readFully(FileStore.java:284)
... 45 more
12-10 09:45:21 database: opening C:\SAClient\data\IBMPROD.SA
org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException:
Insufficient system resources exist to complete the requested
service"; "C:\SAClient\data\IBMPROD.SA.h2.db" [90031-124]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.convertIOException(Message.java:329)
at org.h2.store.FileStore.readFully(FileStore.java:286)
at org.h2.store.PageStore.readPage(PageStore.java:969)
at org.h2.store.PageStore.getPage(PageStore.java:490)
at org.h2.store.PageStore.getFreeList(PageStore.java:802)
at org.h2.store.PageStore.allocatePage(PageStore.java:864)
at org.h2.store.PageStore.allocatePage(PageStore.java:856)
at org.h2.index.PageDataLeaf.split(PageDataLeaf.java:352)
at org.h2.index.PageDataNode.addRowTry(PageDataNode.java:153)
at org.h2.index.PageDataNode.addRowTry(PageDataNode.java:145)
at org.h2.index.PageDataIndex.addTry(PageDataIndex.java:149)
at org.h2.index.PageDataIndex.add(PageDataIndex.java:122)
at org.h2.table.TableData.addRow(TableData.java:130)
at org.h2.store.PageStore.redo(PageStore.java:1196)
at org.h2.store.PageLog.recover(PageLog.java:285)
at org.h2.store.PageStore.recover(PageStore.java:1051)
at org.h2.store.PageStore.openExisting(PageStore.java:310)
at org.h2.store.PageStore.open(PageStore.java:268)
at org.h2.engine.Database.getPageStore(Database.java:2305)
at org.h2.engine.Database.open(Database.java:624)
at org.h2.engine.Database.openDatabase(Database.java:227)
at org.h2.engine.Database.<init>(Database.java:221)
at org.h2.engine.Engine.openSession(Engine.java:58)
at org.h2.engine.Engine.openSession(Engine.java:142)
at org.h2.engine.Engine.getSession(Engine.java:122)
at org.h2.engine.SessionFactoryEmbedded.createSession
(SessionFactoryEmbedded.java:17)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer
(SessionRemote.java:245)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:223)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:58)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.sps.sa.services.H2Service.startDB(H2Service.java:49)
at com.sps.sa.services.SADBService.startDB(SADBService.java:53)
at com.sps.sa.db.SADBServiceManager.startDataBases
(SADBServiceManager.java:45)
at com.sps.sa.views.MainFrame.jbInit(MainFrame.java:176)
at com.sps.sa.views.MainFrame.<init>(MainFrame.java:72)
at com.sps.sa.views.MainFrame.<clinit>(MainFrame.java:42)
at com.sps.sa.views.SAClient.<init>(SAClient.java:47)
at com.sps.sa.views.SAClient.main(SAClient.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sps.sa.views.SplashScreen.<init>(SplashScreen.java:64)
at com.sps.sa.views.SplashScreen.main(SplashScreen.java:86)
Caused by: java.io.IOException: Insufficient system resources exist to
complete the requested service
at java.io.RandomAccessFile.readBytes(Native Method)
at java.io.RandomAccessFile.read(Unknown Source)
at java.io.RandomAccessFile.readFully(Unknown Source)
at org.h2.store.FileStore.readFully(FileStore.java:284)
... 45 more
> Could you send them please?
> - After how long do you usually get this problem?
I put in debug statements right before the getconnection and right
after. I'm not exactly sure how long as I did not timestamp the
statements. But it seems about couple seconds into establishing the
connection. The second debug statement obviously does not get written
when the failure occurs.
> Could you provide the link where you found this information, except
> for the one you aleady sent?
I don't have any other links. I saw that last link as well. I can't
say for certain that the non paged Kernel is the issue. It is just
something we found in common with the failed machines. All 'good'
machines had a larger total Kernel and non paged whereas the failed
machines were all smaller in that regard. It is totally possible that
it could be something totally else and that is just a coincidence.
> // connection = DriverManager.getConnection("jdbc:h2:tcp://
> localhost/" + path + ";CACHE_SIZE=512000", "sa", "");
The cache size is quite large. Could you try if it works using the
default cache size? And if yes, if it works using 128000. I would
probably not use a higher value (I don't think it will help
performance a lot).
> java -Xms256m -Xmx900m -jar EvoClient.jar
Could you try with a lower value, for example:
java -Xmx256m -jar EvoClient.jar
I'm not saying what you have used is wrong, I just like to find out if
using lower value solves the problem.
Regards,
Thomas
Some of the queries ran out of memory with the default cache size. I
probably could get away with 256000 though but haven't tried it.
I did try the connection without specifying the cache size at all and
got the same resource error.
> Some of the queries ran out of memory with the default cache size.
That may be a different problem. Could you post the query that ran out
of memory? Also, could you run it with EXPLAIN SELECT ... and post the
query plan?
Regards,
Thomas