Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.09/5 (7 votes)
See more:
Dear Sir,
I want to get clear data which is store in RAM,in c#
Please help me
Posted
Updated 4-Jul-19 23:22pm
Comments
Sergey Alexandrovich Kryukov 24-Sep-13 8:59am    
Not clear. Do you mean deallocation (then Solution 1 is the answer), or do you want to clean up secret information?
—SA

.Net uses an automated garbage collection process for freeing up RAM.

When an object is disposed or becomes out of context (Disassociated from any other object which is in context) then the garbage collector will remove it from RAM.

You can access the garbage collector object using the GC class.

The following is a good article about performance optimisation using garbage collection.

Garbage Collector Basics and Performance Hints[^]
 
Share this answer
 
v2
Comments
Eduard Keilholz 24-Sep-13 8:56am    
Either one of us didn't understand the question... ;)
CPallini 24-Sep-13 9:01am    
At a glance, you did not.
Sergey Alexandrovich Kryukov 24-Sep-13 8:59am    
5ed.
—SA
C# will manage memory usage for you. If you declare a string and give it a value :
C#
string helloText = "Hello there";

C# will allocate memory and store the data in ram for you. Reading the value of the string will result in reading the value from memory.

In C#, there is no way to access RAM directly.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Sep-13 9:03am    
I up-voted this by... 4. To be more precise, "Hello there" may be allocated, but also it may create a reference to the intern pool where this string is already found; same thing about deallocation. This is a very delicate peculiarity related to strings only. Perhaps you should have told about some other objects.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900