Re: Java Memory question
On 14/03/11 17:24, Eric wrote:
On Mar 14, 12:59 pm, markspace <-@.> wrote:
On 3/14/2011 8:04 AM, Eric wrote:
...
Am I missing anything? Any particular tips to avoiding the
OutOfMemory exception other than increasing the initial memory
allocation?
Increasing the maximum memory is a good way to avoid out of memory
errors. I'm really at a loss as to what Java WebStart has to do with
all of this. Client and server are two different things, they don't
affect each others' memory. I'm wondering why you think they do.
You should have a test harness that you can test these programs
(server/client) independently. Including out of memory, so you're sure
you know the limits of each one, and that those limits correspond to the
way you thought you designed the software.
I'm using JNLP. Am I misunderstanding? I thought the webstart set up
one JVM to share memory for client and server objects.
Absolutely not. Web Start is merely a mechanism for a server to deliver
an application to a client via the WWW. JNLP is the delivery descriptor.
AFAIK it defines no communication between the client application and the
server, and most definitely does not (because it's impossible) allow
sharing of memory space between a client and server. If your application
communicates with a server for the transfer of data then that is a
different matter (I'm pretty sure it's not provided by Web Start and
JNLP), and if your client receives data from the server then it is a
copy of the server's data, presumably delivered over a stream by
serialization.
Is this not the memory limit? Is there another parameter I'm missing?
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"
initial-heap-size="24m" max-heap-size="128m"/>
That defines the memory allocation for the client. The memory allocation
for a server with which the client communicates is something else entirely.
I have my local PC set up to act as both client and server. I also
have a test server and a live server.
I hit an out of memory condition when I tried to use a custom object
with stream cloning (ObjectOutputStream/ObjectInputStream).
In the server or the client?
--
Nigel Wade