Remoter Server Size grows
-
Hi, I have an intranet application that uses remoteserver to access the Business and Data Access layer. The remoteserver is singleton. The application is working fine but with time the remoteserver size in memory increase and then closes down throwing OUT OF MEMORY exception. The size when it is started is 30 MB but within hours it grows to 1 GB. Can any one help me solve this problem?
-
Hi, I have an intranet application that uses remoteserver to access the Business and Data Access layer. The remoteserver is singleton. The application is working fine but with time the remoteserver size in memory increase and then closes down throwing OUT OF MEMORY exception. The size when it is started is 30 MB but within hours it grows to 1 GB. Can any one help me solve this problem?
-
It sounds like you're loading classes multiple times and not calling the dispose method. These are very tricky to diagnose. I would start it up on your development PC and track the resources being used in the locals window.
Since it is Singleton the objects are created when there is a call and all future calls are served by the same object. I have used memory profiler and it shows only 1 instance of each object so that is not the issue.
-
Since it is Singleton the objects are created when there is a call and all future calls are served by the same object. I have used memory profiler and it shows only 1 instance of each object so that is not the issue.
Yes, Singleton will have only one instance of that class running. However, that's not to say that the objects within it aren't spawning out of control. Using memory profiler will show the full memory useage of the class itself. It won't let you break down the different components. That's why I suggested to use the locals window of VS.
-
Yes, Singleton will have only one instance of that class running. However, that's not to say that the objects within it aren't spawning out of control. Using memory profiler will show the full memory useage of the class itself. It won't let you break down the different components. That's why I suggested to use the locals window of VS.
Seems you are correct. The Handler class that communicates with the UI and DatAccess layer has more than 1 instance which I think should not happen if Remoteserver is Singleton. What do you say?
-
Seems you are correct. The Handler class that communicates with the UI and DatAccess layer has more than 1 instance which I think should not happen if Remoteserver is Singleton. What do you say?
hmmmm....I can't think of any "good" reason for it to have multiple instances. Theoretically, the app should only have one data _connection_, but could spawn off new instances until it runs out of memory. Considering that it's singleton, it should only be able to use one instance at a time. Try creating your instance in a global scope and see if that helps. either that, or add a dispose to instance each time it's called. That will mark it for cleanup through the garbage collector. Either way should narrow that down to one active instance. Once that's done, I'd recommend scanning the app again for any other objects that are being handled in a similar fashion.