JVM Crashes due to memory shortage ...

I have a Java application which runs as a server on my Windows 2000 Server machine having 2GB RAM and virtual memory specified as 2-4GB. I start the application with the options -Xms786m -Xms-786m.

I have around 1500 clients that connect to this server and I open 2 dedicated server sockets for each client. The clients keep sending reuests over these connections for which they get the response over these connections. I connect to an Oracle database using the oracle 'thin' driver for this.

Till recently everything was running fine until I made some very small changes such as addition of some 50-100 users and a few more request-response sets due to which I have run into trouble. My server keeps crashing as soon as it gets around 1600 clients and the memory used by the process reaches around 2GB(seen through Perfmon). Sometimes I get the error :

Exception in thread 搈ain?java.lang.OutOfMemoryError: request <size> bytes for <reason>. Out of swap space

and sometimes the jvm terminates without any error/message.

I also profiled the server but there dont seem to be any problems with the objects on the heap. I know that this is because I am running short of native heap memory. How can I identify what is causing this and is there any way to increase this limit ?

[1323 byte] By [pankajatncsta] at [2007-10-2 14:33:45]
# 1

Did you mean you use -Xms786m -Xmx786m?

If so, did you try increasing that to -Xms1024 -Xmx1024?

I thought I read somewhere that there is a ultimate limit of 2G for JRE on 32-bit Windows.

I would say that ultimately, if you find there is a JRE memory limitation that prevents a single JRE from using all available system memory, that you could always split your application into several separate JRE's that communicate with each other using the best interprocess service available.Split your app into an upper tier to handle all the client setup/teardown and a lower tier to handle other stuff. Or maybe some other logic split that works better for your application/design.

ddanimala at 2007-7-13 12:57:22 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

> Did you mean you use -Xms786m -Xmx786m?

> If so, did you try increasing that to -Xms1024

> -Xmx1024?

Yes, I meant that only. But the problem I am facing is for the native heap memory and not the user heap memory. Increasing the user heap size further decreases the memory which can be utilized for the native heap memory.

> I thought I read somewhere that there is a ultimate

> limit of 2G for JRE on 32-bit Windows.

Infact this is the limit for any process running on 32-bit windows machine. The total address space which the os can handle with 32-bits is 4GB and it limits each process to 2GB.

pankajatncsta at 2007-7-13 12:57:22 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...