0
Just to put it in context, I’m upgrading an image search engine and need to save the previous search to the session:
public static void SavePreviousSearch(APIStandardSearchResponse search)
{
HttpContext.Current.Session[PREVIOUS_SEARCH_KEY] = search;
}
And I call it within a search process in which I mount a APIStandardSearchResponse
:
SearchCookieController.SavePreviousSearch(APIStandardSearchResponse);
Then when necessary I retrieve this object:
APIStandardSearchResponse previousSearch = SearchCookieController.GetPreviousSearch();
I would like to know the memory space (on the server) that the object previousSearch
is occupied. It is possible to do this with the c#?
But if the session is being stored as a cookie, it is not in memory, it is literally a cookie on the server.
– Leandro Angelo
@Leandroangelo is like a physical file, type saved in hard drive/ssd ?
– Leonardo Bonetti
It actually depends on the way you chose to store, take a look here https://www.c-sharpcorner.com/UploadFile/3d39b4/introduction-toAsp-Net-session/
– Leandro Angelo
But why are you worried about it? You are planning to store a large volume of data in Session?
– Leandro Angelo
So Leandro, I have a list inside this object with another 100 objects (search results) then I was afraid because each user I search will store this search in Session...
– Leonardo Bonetti
I do not know how much memory these objects use, so that in the future when increase the number of users I do not have this problem
– Leonardo Bonetti
The reason for storing is not the case, but it is necessary to store in some way.
– Leonardo Bonetti
Maybe dup https://answall.com/q/199618/101
– Maniero