Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / April 2004

Tip: Looking for answers? Try searching our database.

thread increases memory usage.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
XYZ - 13 Apr 2004 07:21 GMT
Hi
  I tried to spawn a thread on button clicking event. Inside the thread function i have the code for moving some graphical objects on the winform
  For each button click new thred is started . I have noticed that it is making the 'memory uage' and 'handles' are getting increased
  Do I have to kill the thread manually ??

thanx in advanc
XYZ
Nick Wienholt - 13 Apr 2004 12:33 GMT
Use the thread pool - creating threads is an expensive operation.  The
resources used by a thread object will eventually be reclaimed, but it will
take a few GC cycles.

You'll also need to BeginInvoke to get back to the UI thread, so unless
you're doing expensive operations before the moving, the best option will be
to do the work on the UI thread.

Nick Wienholt, MVP

Maximizing .NET Performance

http://www.apress.com/book/bookDisplay.html?bID=217

Sydney Deep .NET User Group www.sdnug.org

www.dotnetperformance.com

> Hi,
>    I tried to spawn a thread on button clicking event. Inside the thread function i have the code for moving some graphical objects on the winform.
[quoted text clipped - 3 lines]
> thanx in advance
> XYZ
cody - 17 Apr 2004 21:41 GMT
>    I tried to spawn a thread on button clicking event. Inside the thread function i have the code for moving some graphical objects on the winform.
>    For each button click new thred is started . I have noticed that it is making the 'memory uage' and 'handles' are getting increased.
>    Do I have to kill the thread manually ??

Every thread has its own stack and a thread handle. If the thread function
returns, all resources are automatically freed.

Signature

cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.