Service Memory Limitations

C

Craig W Gulliver

I'm developing a Java Server Application. It is deployed
as a service program.

The problem is that the app requires a large amount of
memory, anywhere from 24MB to 1GB. The application fails
between 250MB to 300MB of memory usage.

The machine is a quad processor, with Xeon P4 1.8 Gz
processors and 4GB of RAM.

Are there any known limitations or memory restrictions for
services on Windows 2000? Any comments or ideas are
welcome. Please reply to my email address.

Thanks in advance,

Craig
 
J

John Phillips

Sorry, but the question is a little vague. Are you trying to allocate 1GB
at once? Or in chunks?

And when you say that "the application fails", do you mean that the memory
allocation fails? Or the application crashes?

And how are you allocating the memory? Using the regular Win32 API calls?
Or some Java-specific functions?

AFAIK, with respect to memory allocation, services have no more restrictions
than normal applications do. I would suggest trying to perform your memory
allocation in a Java program, and then again in a plain-vanilla-Win32
application (C/C++, using VirtualAlloc) to try and get a better handle on
the actual problem. My inital guess is that there is some limitation with
the Java VM, but without more information...


--
John Phillips
MVP - Windows SDK


PS. Responding to a newsgroup question via email is generally considered bad
form (see http://www.catb.org/~esr/faqs/smart-questions.html#noprivate for
reasons). Therefore I have posted my answer here, and will alert you to it
via email.
 
C

Craig W Gulliver

Sorry, let me give some more details. I didn't expect any
replies :)

The application is a java server app. But it is wrapped
by a Service program that is used to start and stop it.
The service is more or less a thin shell, ie not much
processing or memory usage.

The Java VM is configured to use a minimum 8M and max
1024MB of memory depending on its requirements. The
memory allocation is done by the VM's garbage collection
(GC). When the heap needs more memory then the GC
performs some memory allocation. The amount is dependent
on the amount requested minus the amount available.

The point of failure is in the memory allocation, where
the VM reports an OutOfMemoryError which affects the
application. I've confirmed that there is plenty of
physical memory remaining.

The reason for my question about the memory limitations of
services is due to my most recent test. I ran the
application server outside of the service (ie in a console
window) and did not experience the memory allocation
failure.

Could it also be an OS/System configuration that would
prevent a service process from exceeding some memory limit?

These are only speculations, and it would be great if I
have a definitive answer.

Thanks for your quick reply :)

Craig
 

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

Top