473,395 Members | 1,641 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,395 software developers and data experts.

VB App hanging in memory

Have noticed that my app sometimes hangs in memory.

It is a multithreaded app with a main thread and a worker thread but I call
something to spin it down on quiting.

Any ideas as to why this would be happening?

Anyone else had this?

Thanks,

Shane
Nov 20 '05 #1
4 1041
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:
Have noticed that my app sometimes hangs in memory.

It is a multithreaded app with a main thread and a worker thread but I call
something to spin it down on quiting.

Any ideas as to why this would be happening?


No.

Post code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
herfried is getting angrier in his old age. =)
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c0*************@ID-208219.news.uni-berlin.de...
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:
Have noticed that my app sometimes hangs in memory.

It is a multithreaded app with a main thread and a worker thread but I call something to spin it down on quiting.

Any ideas as to why this would be happening?


No.

Post code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
* "CJ Taylor" <no****@blowgoats.com> scripsit:
herfried is getting angrier in his old age. =)


Mhm... I am not anyry.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
ok.

I have fixed in in a sort of "guess" way.

I was using the paradigm given by the Wrox Professional VB.NET book to
manage my thread.

According to them I go this basic strategy in a workerclass for my thread

Public Sub Cancel()
_bIsCancelled = True
_paused.Set()
End Sub

Public Sub SpinUp()
Dim start As New ThreadStart(AddressOf Me.Start)
_thread = New Thread(start)
_thread.Name = "My thread name"
_thread.Start()
End Sub

spindown only had
Cancel()
_thread.Join
_thread=nothing
This according to the Wrox book.
For me it kept hanging the app in memory. Like the join was waiting forever.
I don't know why. So I decided to try to timeout in 1 second and kill it
using .Abort.

Is this a bad solution? Is there something better? Code with changes
below:

Public Sub SpinDown()
Cancel()
_thread.Join(1000) 'waits for thread to finish
_thread.Abort() 'shane changed to timeout and then abort; was hanging in
memory. 2-18-04
_thread = Nothing 'set thread to nothing
End Sub

Thanks for your help.

Shane
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c0*************@ID-208219.news.uni-berlin.de...
* "SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> scripsit:
Have noticed that my app sometimes hangs in memory.

It is a multithreaded app with a main thread and a worker thread but I call something to spin it down on quiting.

Any ideas as to why this would be happening?


No.

Post code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5

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

Similar topics

7
by: Simon | last post by:
My webhosting company cut off my website the other day because i had "too many hanging processes" What does this mean and what can i do to prevent this from happening. They gave me the following...
6
by: Harlan Messinger | last post by:
A publication style guide indicates that for a table heading like the following, Table 3. Wheat and rye harvest in European countries in years that end in 3 or 7 or when a new prime minister...
25
by: Shannon Jacobs | last post by:
Maybe there is a simple trick here, and I'm not spotting it... Is there a guru of CSS hanging around here who can help out? The page in question has a multi-column table with a list of links in...
8
by: briforge | last post by:
I am writing a program for the Palm OS in c++. I have already posted this to a palm development forum but I'm desperate for a fix, so I hope this cross-post isn't offensive. My program is...
1
by: KyleK | last post by:
I am developing a standalone .exe in VB.NET. This is my first full application since vb6. The sln. contains 2 projects and around 50 classes(including forms). For the first 6 weeks it was...
5
by: David C. Allen | last post by:
I have a vb.net app that is controling excel 2000 thru the com interop interface. I have referenced the excel 9.0 library and have cut down the code in the problem subroutine to this: Dim...
1
by: Marcel Groner | last post by:
I have a problem with postgresql runnung on smp kernel. setup: master: ------- - Pentium 4 (hyperthreading) - 2 GB Memory - os: fedora core 1 - kernel: 2.4.22-1.2188.nptlsmp
1
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello guys, I was wondering if anybody here had implemented a solution where Tables are aligned according to what the hanging indent tells us when there is a potential for the table overflowing...
5
by: Stanimir Stamenkov | last post by:
I'm trying to style an icon "hanging" below the first line of a heading and I've found interesting difference between Mozilla and the other browsers I'm trying with - Safari 3.1.1, Opera 9.27 and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.