954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sharing memory data with iis between users on the same page

Hy,

Let's say that I have class Node with some parameters Node[] child's, string id, string content ...
This class is like a another storage for data from mssql database.
And that web-application is running on IIS server and is written in ASP.NET C#

Now when one user open that page, certain data is dumped from db into that instance Node class depends on which sub-page user open.
And then another user open the same page and the same sub-page .. but again the same data is dumped into another instance of class Node.

What I want is to share that Node class between users, is that possible, so one user open the page and if no instance of Node class is made, new one is created, otherwise the same Node class is used and I'll use much, much less memory with the application :}

rico196
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

When a asp.net web page is accessed remotely by a user, IIS process the request and sends the output to the user. For processing the request, it may create some temprory variables based on the program logic that you have written. The temprory memory data will be cleared by .NET CLR once the response is sent to the client browser.

IIS will not store any data in memory unless you store data specific to users in Session. If you want to save memory, do not store values in Session, Application and Cache objects.

If you want to share the instance of a class in .NET, you need to implement Single Desig Pattern.

Check the following links.
Implementing Singleton in C#

Singleton Design Pattern

Implementing the Singleton Pattern in C#

Ramesh S
Posting Pro
583 posts since Jun 2009
Reputation Points: 165
Solved Threads: 113
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: