Setting Derby NetworkServer JVM size using NetworkServerControl

2011-11-09 Thread Hawley, Dan
Hi,

I have an urgent problem that I have not been able to solve by myself.  I am 
populating many derby databases with data in preparation for going live with a 
new application.  After opening about 10 databases, the Derby Network Server 
crashes with an java.lang.OutOfMemoryError.  See derby log below.  We start the 
Derby Network Server with a batch file that I also have below.  I think I need 
to allocate more memory to the Derby Network Server's JVM but I can't see how 
to do that using the NetworkServerControl to start the server.  Does anyone 
know how to do this?  What is a reasonable memory allocation for the JVM?  
Another question I have is: Am I doing something wrong having by having Derby 
load this many databases?  I am using Hibernate JPA with Derby for my 
application.  I am closing the EntityManagerFactory and EntityManager objects 
when I close the application.

Your assistance and advice is greatly appreciated.  Thanks, Dan

=start derby server.bat file=
f:
cd f:\epns\database\EditorDatabase
%DERBY_HOME%\bin\NetworkServerControl start -h secapp -p 1527


===derby server crashed = ran out of memory ==


2011-11-08 21:53:28.187 GMT : Apache Derby Network Server - 10.6.1.0 - (938214) 
started and ready to accept connections on port 1527

2011-11-08 22:12:56.443 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance a816c00e-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\DBEDIT-B   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:26:30.306 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance 274b9034-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011103AD   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:28:27.370 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance 636e50d2-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011103AC   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:31:06.678 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance f7f21170-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011100BM   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:33:08.717 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance 64d6d20e-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011102-A   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:37:12.133 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance 2a1c92ac-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011200-Y   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:41:16.888 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance c7c3534a-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011201-F   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:43:54.771 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance bdcb13e8-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\DBITST-A   with class 
loader sun.misc.Launcher$AppClassLoader@fabe9

Database Class Loader started - derby.database.classpath=''

2011-11-08 22:48:35.977 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.6.1.0 
- (938214): instance 74f89535-0133-852b-e9db-003a53a0
on database directory F:\EPNS\database\EditorDatabase\011101AE   with class 
loader 

Re: Setting Derby NetworkServer JVM size using NetworkServerControl

2011-11-09 Thread Peter Ondruška
append:
DERBY_OPTS=-Xms1g -Xmx1g
to bin\derby_common.bat

On Wed, Nov 9, 2011 at 5:39 PM, Hawley, Dan dan.haw...@lmco.com wrote:
 Hi,

 I have an urgent problem that I have not been able to solve by myself.  I am 
 populating many derby databases with data in preparation for going live with 
 a new application.  After opening about 10 databases, the Derby Network 
 Server crashes with an java.lang.OutOfMemoryError.  See derby log below.  We 
 start the Derby Network Server with a batch file that I also have below.  I 
 think I need to allocate more memory to the Derby Network Server's JVM but I 
 can't see how to do that using the NetworkServerControl to start the server.  
 Does anyone know how to do this?  What is a reasonable memory allocation for 
 the JVM?  Another question I have is: Am I doing something wrong having by 
 having Derby load this many databases?  I am using Hibernate JPA with Derby 
 for my application.  I am closing the EntityManagerFactory and EntityManager 
 objects when I close the application.

 Your assistance and advice is greatly appreciated.  Thanks, Dan

 =start derby server.bat file=
 f:
 cd f:\epns\database\EditorDatabase
 %DERBY_HOME%\bin\NetworkServerControl start -h secapp -p 1527


 ===derby server crashed = ran out of memory ==


 2011-11-08 21:53:28.187 GMT : Apache Derby Network Server - 10.6.1.0 - 
 (938214) started and ready to accept connections on port 1527
 
 2011-11-08 22:12:56.443 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance a816c00e-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\DBEDIT-B   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:26:30.306 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance 274b9034-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011103AD   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:28:27.370 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance 636e50d2-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011103AC   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:31:06.678 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance f7f21170-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011100BM   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:33:08.717 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance 64d6d20e-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011102-A   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:37:12.133 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance 2a1c92ac-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011200-Y   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:41:16.888 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance c7c3534a-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\011201-F   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:43:54.771 GMT:
  Booting Derby version The Apache Software Foundation - Apache Derby - 
 10.6.1.0 - (938214): instance bdcb13e8-0133-852b-e9db-003a53a0
 on database directory F:\EPNS\database\EditorDatabase\DBITST-A   with class 
 loader sun.misc.Launcher$AppClassLoader@fabe9

 Database Class Loader started - derby.database.classpath=''
 
 2011-11-08 22:48:35.977 GMT:
  Booting Derby version The Apache