473,587 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

clearing memory from dictionary

buu
It's strange to me, but, create a dictionary and fill it with 1 mil. of some
objects.
then, see the memory consumption (arised, of course).

then, clean the dictionary.... memory consumption is the same...
write MyDic=nothing

memory consumption is still the same
force GC to collect... memory consumption is little bit smaller

why?
how can I release memory prevously kept by dictionary?
Jul 31 '07 #1
1 2320
buu wrote:
It's strange to me, but, create a dictionary and fill it with 1 mil. of some
objects.
then, see the memory consumption (arised, of course).

then, clean the dictionary.... memory consumption is the same...
write MyDic=nothing

memory consumption is still the same
force GC to collect... memory consumption is little bit smaller
Forcing a garbage collection rarely has any dramatic effect. If a
garbage collection is needed, it will be done automatically.
why?
how can I release memory prevously kept by dictionary?
The memory will be released if it's needed for something else.

What you are seeing is not the amount of memory that is used for active
objects, you see the amount of memory that is currently allocated for
the memory heaps in the .NET memory management system. If you want to
see how much memory is really used, you should use a memory profiler.

--
Göran Andersson
_____
http://www.guffa.com
Aug 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2145
by: Elbert Lev | last post by:
Hi, all! Here is the problem: I have a file, which contains a common dictionary - one word per line (appr. 700KB and 70000 words). I have to read it in memory for future "spell checking" of the words comming from the customer. The file is presorted. So here it goes: lstdict = map(lambda x: x.lower().strip(),...
8
2477
by: Benjamin Scott | last post by:
Hello. I attempted to build a compound dictionary: len(Lst)=1000 len(nuerLst)=250 len(nuestLst)=500 Dict={}
1
2908
by: DJTB | last post by:
zodb-dev@zope.org] Hi, I'm having problems storing large amounts of objects in a ZODB. After committing changes to the database, elements are not cleared from memory. Since the number of objects I'd like to store in the ZODB is too large to fit in RAM, my program gets killed with signal 11 or signal 9... Below a minimal working (or...
6
3683
by: Ganesan selvaraj | last post by:
I using C# .net. i want to split the text files based of the some condition. my source text file size may be 4 kb to 4 gb. some time when i split the i got the "out of memory exception. when i read from the file i read the 10mb and split the this content and clear the buffer and read the second 10 mb and so on. How can i rectify the...
3
342
by: RubenDV | last post by:
I am writing code for a dictionary type in c, but i have some problems allocating the memory for it. The dictionary type itself is a struct with the following contents: typedef struct { char ** keys; char ** content; int count; /* Amount of space actually used */ int allocated_space; /* Amount of space allocated for the keys and content...
4
2788
by: Kev | last post by:
Hello, I have an Access 2003 database running on an XP network. I have a datasheet subform containing a 28 day roster - shift1 to shift28. Each record has 1 RosterEmpID, 1 EmployeeNumber, 28 shift fields, and 1 shiftTotal field and 1 HoursTotal field. Datasheet may look like:
6
5704
by: koara | last post by:
What is the best to go about using a large set (or dictionary) that doesn't fit into main memory? What is Python's (2.5 let's say) overhead for storing int in the set, and how much for storing int -> int mapping in the dict? Please recommend a module that allows persistent set/dict storage + fast query that best fits my problem, and as...
2
4499
by: Nagu | last post by:
I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine later if this is a problem due to limited resources (memory) on the machine (it is 32 bit machine Win XP, with 4GB RAM). Here is the detail...
4
7959
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hi all, Recently I found an interesting question on C# forums about clearing event handlers of an event. I tried to give it a solution, but failed. I am interested to know how you guys take this. Here it goes class Product { public event EventHandler ProductChanged;
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.