473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Clearing Memory

Hi All,

I am creating an instance many times for a class in Runtime(for a minute it will create 100 instance).

That thread is running 24 Hrs /Day.

How to clear the memory which was created by those thread.


Pls Give me a solution.
Sep 26 '07 #1
4 1324
Shashi Sadasivan
1,435 Expert 1GB
The inbuilt garbage collector should do it by itself!

If not use the GC class

cheers
Sep 26 '07 #2
Plater
7,872 Expert 4TB
You should try and find ways to close all file handles (sockets, files, streams, whatever) call .Close() on anything that has it, .Dispose() on anything that has it.
Then as a last resort you can use GC.Collect(); to clear up anything left over.


I'm actually in the process of doing this right now myself.
Sep 26 '07 #3
You should try and find ways to close all file handles (sockets, files, streams, whatever) call .Close() on anything that has it, .Dispose() on anything that has it.
Then as a last resort you can use GC.Collect(); to clear up anything left over.


I'm actually in the process of doing this right now myself.
Hi Thanks for ur solution. Now i am working with designing a server using socket programming. so it will available for 24X7 . Is there any chance clearing memories in this regard
Sep 27 '07 #4
Plater
7,872 Expert 4TB
What do mean clearing memory with the socket?
Remember to close all your Sockets (and any underlying streams, look at the descriptions of the functions if you are unsure)
Sep 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Robin | last post by:
Ok, I have a form that on clicking of the Update button first updates the specific record in the db, then Inserts if the vMemo field is not empty. The problem that I'm having is that After...
18
by: Niels | last post by:
Hi group, I have some problems with clearing floated divs. My usual method works fine in Konqueror, but not in Firefox. Here's an example: <html><body> <div id='left' style='float:left;...
7
by: Martin Magnusson | last post by:
I'm having trouble clearing and resizing a static std::vector of std::vectors (segmentation fault). Is it OK to call clear() and resize() on a static attribute? My code is similar to the one posted...
2
by: Andrew Poulos | last post by:
If I'm using DOM methods to dynamically create elements in a page is it necessary for me to clear whatever variables I used to create the elements when the page unloads? I'm reading bits and...
3
by: Q | last post by:
Hello, I have composed an xhtml file and corresponding css file with styles. It works OK. The problem is that I change my xhtml and css files and cannot see these changs with my browser. To see...
14
by: Jason | last post by:
Hi. I have a structure that was used in a previous iteration of a loop, and I want to clear out all the structures values that the previous iteration assigned without assigning every variable to...
12
by: Michael | last post by:
Hello Newsgroup, I have a 2D-array of doubles. Can I use memset to set all elements to zero like memset ( arrayname, 0, "arraysize" ) or is this not general allowed? Thanks Michael
2
by: Dan | last post by:
In C, it's usually necessary to clear the memory in structures before passing them to certain WinAPI functions. How would one do that in VB.NET?
12
by: Avalon1178 | last post by:
Hi, I have an application that periodically uses a std::string variable which is assigned a VERY VERY large string (15000000+ bytes long). This application is essentially a daemon, and it polls...
1
by: buu | last post by:
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.