Singleton Object memory usage

  • Thread starter Christopher Pragash
  • Start date
C

Christopher Pragash

Hello All,

I created a class object and a console application to host the object as a
Singleton Remoting Object. I overloaded the new inside the class object and
loaded a private Arraylist with some objects. I wrote a function that would
retrieve a range of objects from the Arraylist. I created a client inside
which I called the Singleton Object's function multiple times. I also
started multiple instances of the client and did a simultaneous call to the
Singleton Object. While watching the memory process of the Host Application,
I noted that the memory the process occupied kept growing with every
call...and it never came down. I made sure that multiple instances of the
object are not created by checking a Creation timestamp on the remoting
object and that also ensured that the arraylist was loaded only once. Is
there a reason behind this?? Any theories?

Thanks in advance,

regards,
Chris
 
C

Cowboy \(Gregory A Beamer\)

Did you ensure that the singleton was only called from Application and that
all of the methods were declared so they could not be called outside the
singleton. The most common mistake with singletons is making them session
singleton objects or mixing static and object methods.

--
Gregory A. Beamer
MPV; MCP: +I, SE, SD, DBA

**********************************************************************
Think outside the box!
**********************************************************************
 

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