Home All Groups Group Topic Archive Search About

.net memory leak problem in exe

Author
22 Dec 2005 9:51 AM
anandav2001
Hello developers,

   I have created an executable(system tray application) in VS.net 2003
using VB.net. My app was taking 30 MB memory(since some web services
call are there which happens for each 10 sec checking internet is
available or not). Inorder to reduce huge memory consumption, what i
used is

Public Class MemoryManagement
    Private Declare Function SetProcessWorkingSetSize Lib
"kernel32.dll" ( _
              ByVal process As IntPtr, _
              ByVal minimumWorkingSetSize As Integer, _
              ByVal maximumWorkingSetSize As Integer) As Integer

    Public Shared Sub FlushMemory()
        GC.Collect()
        GC.WaitForPendingFinalizers()
        If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then

SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
        End If
    End Sub
End Class

Now i call FlushMemory on every 10 secs.

Now the memory consumption got reduced  to 2 MB..But the problem is
after running this application for several days continously(say 1 week)
i got .net memory leak exception. I heard that .net memory exception
comes only if your application doesnot leave memory when other apps
need it. Can anyone guide me correctly...

Any help in this regard is greatly appreciated......

Regards,

Anand. A.V

Author
22 Dec 2005 10:01 AM
Zvonko Keber
SetProcessWorkingSetSize does not solve your memory consumption. It only
trims the part of memory that process' once occupied.
You don't need the SetProcessWorkingSetSize at all.

You are probably watching the "Memory Usage" column in task manager. You
should be watching "VM size" column, which is hidden by default. This is
your application's allocated private bytes (total amount of memory allocated
by the process).

You need to make sure you dispose every object you create. If the object
doesn't implement a Dispose method, you should make sure that all references
to the object are lost (every time you associate a variable with the object,
reference is added and you need to set those variables to Nothing).


<anandav2***@gmail.com> wrote in message
Show quote
news:1135245112.318450.235410@g14g2000cwa.googlegroups.com...
> Hello developers,
>
>   I have created an executable(system tray application) in VS.net 2003
> using VB.net. My app was taking 30 MB memory(since some web services
> call are there which happens for each 10 sec checking internet is
> available or not). Inorder to reduce huge memory consumption, what i
> used is
>
> Public Class MemoryManagement
>    Private Declare Function SetProcessWorkingSetSize Lib
> "kernel32.dll" ( _
>              ByVal process As IntPtr, _
>              ByVal minimumWorkingSetSize As Integer, _
>              ByVal maximumWorkingSetSize As Integer) As Integer
>
>    Public Shared Sub FlushMemory()
>        GC.Collect()
>        GC.WaitForPendingFinalizers()
>        If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
>
> SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
>        End If
>    End Sub
> End Class
>
> Now i call FlushMemory on every 10 secs.
>
> Now the memory consumption got reduced  to 2 MB..But the problem is
> after running this application for several days continously(say 1 week)
> i got .net memory leak exception. I heard that .net memory exception
> comes only if your application doesnot leave memory when other apps
> need it. Can anyone guide me correctly...
>
> Any help in this regard is greatly appreciated......
>
> Regards,
>
> Anand. A.V
>
Author
22 Dec 2005 11:04 AM
Anand
Hello,

   Thanx for ur reply. All my objects are in a shared class...and that
too shared properties. On looping (say each 10 sec) i assign what all
values i get from database to these variables. (App is something like
displaying alerts if new activity is there).I need those values till
next looping. So i think i cant make it nothing. ...Any performance
problem if i used shared property in my apps. Also any other reason for
.net memory leak..

Regards ,

Anand


Show quote
"Zvonko Keber" wrote:
>SetProcessWorkingSetSize does not solve your memory consumption. It
only
>trims the part of memory that process' once occupied.
>You don't need the SetProcessWorkingSetSize at all.
>
>You are probably watching the "Memory Usage" column in task manager.
You
>should be watching "VM size" column, which is hidden by default. This
is
>your application's allocated private bytes (total amount of memory
allocated
>by the process).
>
>You need to make sure you dispose every object you create. If the
object
>doesn't implement a Dispose method, you should make sure that all
references
>to the object are lost (every time you associate a variable with the
object,
>reference is added and you need to set those variables to Nothing).
>
>
><anandav2***@gmail.com> wrote in message
>news:1135245112.318450.235410@g14g2000cwa.googlegroups.com...
>> Hello developers,
>>
>>   I have created an executable(system tray application) in VS.net
2003
>> using VB.net. My app was taking 30 MB memory(since some web services
>> call are there which happens for each 10 sec checking internet is
>> available or not). Inorder to reduce huge memory consumption, what i
>> used is
>>
>> Public Class MemoryManagement
>>    Private Declare Function SetProcessWorkingSetSize Lib
>> "kernel32.dll" ( _
>>              ByVal process As IntPtr, _
>>              ByVal minimumWorkingSetSize As Integer, _
>>              ByVal maximumWorkingSetSize As Integer) As Integer
>>
>>    Public Shared Sub FlushMemory()
>>        GC.Collect()
>>        GC.WaitForPendingFinalizers()
>>        If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
>>
>> SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
>>        End If
>>    End Sub
>> End Class
>>
>> Now i call FlushMemory on every 10 secs.
>>
>> Now the memory consumption got reduced  to 2 MB..But the problem is
>> after running this application for several days continously(say 1
week)
>> i got .net memory leak exception. I heard that .net memory exception
>> comes only if your application doesnot leave memory when other apps
>> need it. Can anyone guide me correctly...
>>
>> Any help in this regard is greatly appreciated......
>>
>> Regards,
>>
>> Anand. A.V
>>
>
>



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Author
22 Dec 2005 12:41 PM
Zvonko Keber
Check if you create a new object inside your loop (with "new"), and if you
do, call it's Dispose every time you're finished with it. Otherwise, create
the object only once, and dispose it only once. If you need the object for
future reference, try saving it to disk.


Show quote
"Anand" <an***@trellisys.net> wrote in message
news:%23zyd0duBGHA.1180@TK2MSFTNGP09.phx.gbl...
> Hello,
>
>   Thanx for ur reply. All my objects are in a shared class...and that
> too shared properties. On looping (say each 10 sec) i assign what all
> values i get from database to these variables. (App is something like
> displaying alerts if new activity is there).I need those values till
> next looping. So i think i cant make it nothing. ...Any performance
> problem if i used shared property in my apps. Also any other reason for
> net memory leak..
>
> Regards ,
>
> Anand
>
>
> "Zvonko Keber" wrote:
>>SetProcessWorkingSetSize does not solve your memory consumption. It
> only
>>trims the part of memory that process' once occupied.
>>You don't need the SetProcessWorkingSetSize at all.
>>
>>You are probably watching the "Memory Usage" column in task manager.
> You
>>should be watching "VM size" column, which is hidden by default. This
> is
>>your application's allocated private bytes (total amount of memory
> allocated
>>by the process).
>>
>>You need to make sure you dispose every object you create. If the
> object
>>doesn't implement a Dispose method, you should make sure that all
> references
>>to the object are lost (every time you associate a variable with the
> object,
>>reference is added and you need to set those variables to Nothing).
>>
>>
>><anandav2***@gmail.com> wrote in message
>>news:1135245112.318450.235410@g14g2000cwa.googlegroups.com...
>>> Hello developers,
>>>
>>>   I have created an executable(system tray application) in VS.net
> 2003
>>> using VB.net. My app was taking 30 MB memory(since some web services
>>> call are there which happens for each 10 sec checking internet is
>>> available or not). Inorder to reduce huge memory consumption, what i
>>> used is
>>>
>>> Public Class MemoryManagement
>>>    Private Declare Function SetProcessWorkingSetSize Lib
>>> "kernel32.dll" ( _
>>>              ByVal process As IntPtr, _
>>>              ByVal minimumWorkingSetSize As Integer, _
>>>              ByVal maximumWorkingSetSize As Integer) As Integer
>>>
>>>    Public Shared Sub FlushMemory()
>>>        GC.Collect()
>>>        GC.WaitForPendingFinalizers()
>>>        If (Environment.OSVersion.Platform = PlatformID.Win32NT) Then
>>>
>>> SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1)
>>>        End If
>>>    End Sub
>>> End Class
>>>
>>> Now i call FlushMemory on every 10 secs.
>>>
>>> Now the memory consumption got reduced  to 2 MB..But the problem is
>>> after running this application for several days continously(say 1
> week)
>>> i got .net memory leak exception. I heard that .net memory exception
>>> comes only if your application doesnot leave memory when other apps
>>> need it. Can anyone guide me correctly...
>>>
>>> Any help in this regard is greatly appreciated......
>>>
>>> Regards,
>>>
>>> Anand. A.V
>>>
>>
>>
>
>
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com
Author
22 Dec 2005 1:33 PM
Anand
Hello,

   I didnt create any new object inside the loop..Also i cant set the
object to nothing, we cannot save it to disk as i need to update
variables, i assign it to the variables for future use..ie. if user
clicks the form that is being popuped by system tray app, i need to take
him to our website. He can click the link at any time..and .net leak
happens only after running several days...I ran it for 48 hrs
continously and i worked without any problems...

What i am doing in a timer tick is

dsAlerts = objWebService.GetDesktopAlerts(SharedClass.EmailID)

For x As Integer = 0 To dsAlerts.Tables(0).Rows.Count - 1

SharedClass.aDocId(iarray) = dsAlerts.Tables(0).Rows(x).Item(2)
SharedClass.aDocName(iarray) =
dsAlerts.Tables(0).Rows(x).Item(3)SharedClass.aTime(iarray) =
SharedClass.DateFormat(dsAlerts.Table(0).Rows(x).Item(7), True)
SharedClass.aEmailId(iarray) = dsAlerts.Tables(0).Rows(x).Item(5)
SharedClass.aName(iarray) = dsAlerts.Tables(0).Rows(x).Item(4)
SharedClass.aIpAddress(iarray) = dsAlerts.Tables(0).Rows(x).Item(6)
SharedClass.aIpAddress(iarray) = dsAlerts.Tables(0).Rows(x).Item(6)
SharedClass.aTransCode(iarray) = dsAlerts.Tables(0).Rows(x).Item(8)
SharedClass.aDocType(iarray) = dsAlerts.Tables(0).Rows(0).Item(12)

ReDim Preserve SharedClass.aDocId(SharedClass.aDocId.Length)
ReDim Preserve SharedClass.aDocName(SharedClass.aDocName.Length)
ReDim Preserve SharedClass.aTime(SharedClass.aTime.Length)
ReDim Preserve SharedClass.aEmailId(SharedClass.aEmailId.Length)
ReDim Preserve SharedClass.aIpAddress(SharedClass.aIpAddress.Length)
ReDim Preserve SharedClass.aTransCode(SharedClass.aTransCode.Length)
ReDim Preserve SharedClass.aDocType(SharedClass.aDocType.Length)


sDocId = dsAlerts.Tables(0).Rows(x).Item(2)
sDocName = dsAlerts.Tables(0).Rows(x).Item(3)
sTime = SharedClass.DateFormat(dsAlerts.Tables(0).Rows(x).Item(7),True)
sEmailId = dsAlerts.Tables(0).Rows(x).Item(5)
sName = dsAlerts.Tables(0).Rows(x).Item(4)
sIpAddress = dsAlerts.Tables(0).Rows(x).Item(6)
sTransCode = dsAlerts.Tables(0).Rows(x).Item(8)
bOfflineAlert = dsAlerts.Tables(0).Rows(x).Item(10)
sDocType = dsAlerts.Tables(0).Rows(0).Item(12)
Next


where dsAlerts  is a dataset declared on class level...
objWebService is webservice object on class level...
iarray is integer

SharedClass.aDocId(iarray) etc...is declared as 

     Public Shared aDocId(0) As String
      in sharedClass.vb
sDocId etc are declared as

Dim sDocId  as String in class level...


Please go thru it and guide me in right direction...


Regards,

Anand

Show quote
"Zvonko Keber" wrote:
>Check if you create a new object inside your loop (with "new"), and if
you
>do, call it's Dispose every time you're finished with it. Otherwise,
create
>the object only once, and dispose it only once. If you need the object
for
>future reference, try saving it to disk.
>
>
>"Anand" <an***@trellisys.net> wrote in message
>news:%23zyd0duBGHA.1180@TK2MSFTNGP09.phx.gbl...
>> Hello,
>>
>>   Thanx for ur reply. All my objects are in a shared class...and that
>> too shared properties. On looping (say each 10 sec) i assign what all
>> values i get from database to these variables. (App is something like
>> displaying alerts if new activity is there).I need those values till
>> next looping. So i think i cant make it nothing. ...Any performance
>> problem if i used shared property in my apps. Also any other reason
for
>> net memory leak..
>>
>> Regards ,
>>
>> Anand
>>
>>
>> "Zvonko Keber" wrote:
>>>SetProcessWorkingSetSize does not solve your memory consumption. It
>> only
>>>trims the part of memory that process' once occupied.
>>>You don't need the SetProcessWorkingSetSize at all.
>>>
>>>You are probably watching the "Memory Usage" column in task manager.
>> You
>>>should be watching "VM size" column, which is hidden by default. This
>> is
>>>your application's allocated private bytes (total amount of memory
>> allocated
>>>by the process).
>>>
>>>You need to make sure you dispose every object you create. If the
>> object
>>>doesn't implement a Dispose method, you should make sure that all
>> references
>>>to the object are lost (every time you associate a variable with the
>> object,
>>>reference is added and you need to set those variables to Nothing).
>>>
>>>
>>><anandav2***@gmail.com> wrote in message
>>>news:1135245112.318450.235410@g14g2000cwa.googlegroups.com...
>>>> Hello developers,
>>>>
>>>>   I have created an executable(system tray application) in VS.net
>> 2003
>>>> using VB.net. My app was taking 30 MB memory(since some web
services
>>>> call are there which happens for each 10 sec checking internet is
>>>> available or not). Inorder to reduce huge memory consumption, what
i
>>>> used is
>>>>
>>>> Public Class MemoryManagement
>>>>    Private Declare Function SetProcessWorkingSetSize Lib
>>>> "kernel32.dll" ( _
>>>>              ByVal process As IntPtr, _
>>>>              ByVal minimumWorkingSetSize As Integer, _
>>>>              ByVal maximumWorkingSetSize As Integer) As Integer
>>>>
>>>>    Public Shared Sub FlushMemory()
>>>>        GC.Collect()
>>>>        GC.WaitForPendingFinalizers()
>>>>        If (Environment.OSVersion.Platform = PlatformID.Win32NT)
Then
>>>>
>>>> SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1,
-1)
>>>>        End If
>>>>    End Sub
>>>> End Class
>>>>
>>>> Now i call FlushMemory on every 10 secs.
>>>>
>>>> Now the memory consumption got reduced  to 2 MB..But the problem is
>>>> after running this application for several days continously(say 1
>> week)
>>>> i got .net memory leak exception. I heard that .net memory
exception
>>>> comes only if your application doesnot leave memory when other apps
>>>> need it. Can anyone guide me correctly...
>>>>
>>>> Any help in this regard is greatly appreciated......
>>>>
>>>> Regards,
>>>>
>>>> Anand. A.V
>>>>
>>>
>>>
>>
>>
>>
>> --
>> Sent via .NET Newsgroups
>> http://www.dotnetnewsgroups.com
>
>



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Author
22 Dec 2005 2:45 PM
Zvonko Keber
Can you keep only last few hours (or days) in memory, and disregard
everything older,
or do you need everything you ever received?


Show quote
"Anand" <an***@trellisys.net> wrote in message
news:uAI$CxvBGHA.3572@TK2MSFTNGP14.phx.gbl...
> Hello,
>
>   I didnt create any new object inside the loop..Also i cant set the
> object to nothing, we cannot save it to disk as i need to update
> variables, i assign it to the variables for future use..ie. if user
> clicks the form that is being popuped by system tray app, i need to take
> him to our website. He can click the link at any time..and .net leak
> happens only after running several days...I ran it for 48 hrs
> continously and i worked without any problems...
>
> What i am doing in a timer tick is
>
> dsAlerts = objWebService.GetDesktopAlerts(SharedClass.EmailID)
>
> For x As Integer = 0 To dsAlerts.Tables(0).Rows.Count - 1
>
> SharedClass.aDocId(iarray) = dsAlerts.Tables(0).Rows(x).Item(2)
> SharedClass.aDocName(iarray) =
> dsAlerts.Tables(0).Rows(x).Item(3)SharedClass.aTime(iarray) =
> SharedClass.DateFormat(dsAlerts.Table(0).Rows(x).Item(7), True)
> SharedClass.aEmailId(iarray) = dsAlerts.Tables(0).Rows(x).Item(5)
> SharedClass.aName(iarray) = dsAlerts.Tables(0).Rows(x).Item(4)
> SharedClass.aIpAddress(iarray) = dsAlerts.Tables(0).Rows(x).Item(6)
> SharedClass.aIpAddress(iarray) = dsAlerts.Tables(0).Rows(x).Item(6)
> SharedClass.aTransCode(iarray) = dsAlerts.Tables(0).Rows(x).Item(8)
> SharedClass.aDocType(iarray) = dsAlerts.Tables(0).Rows(0).Item(12)
>
> ReDim Preserve SharedClass.aDocId(SharedClass.aDocId.Length)
> ReDim Preserve SharedClass.aDocName(SharedClass.aDocName.Length)
> ReDim Preserve SharedClass.aTime(SharedClass.aTime.Length)
> ReDim Preserve SharedClass.aEmailId(SharedClass.aEmailId.Length)
> ReDim Preserve SharedClass.aIpAddress(SharedClass.aIpAddress.Length)
> ReDim Preserve SharedClass.aTransCode(SharedClass.aTransCode.Length)
> ReDim Preserve SharedClass.aDocType(SharedClass.aDocType.Length)
>
>
> sDocId = dsAlerts.Tables(0).Rows(x).Item(2)
> sDocName = dsAlerts.Tables(0).Rows(x).Item(3)
> sTime = SharedClass.DateFormat(dsAlerts.Tables(0).Rows(x).Item(7),True)
> sEmailId = dsAlerts.Tables(0).Rows(x).Item(5)
> sName = dsAlerts.Tables(0).Rows(x).Item(4)
> sIpAddress = dsAlerts.Tables(0).Rows(x).Item(6)
> sTransCode = dsAlerts.Tables(0).Rows(x).Item(8)
> bOfflineAlert = dsAlerts.Tables(0).Rows(x).Item(10)
> sDocType = dsAlerts.Tables(0).Rows(0).Item(12)
> Next
>
>
> where dsAlerts  is a dataset declared on class level...
> objWebService is webservice object on class level...
> iarray is integer
>
> SharedClass.aDocId(iarray) etc...is declared as
>
>     Public Shared aDocId(0) As String
>      in sharedClass.vb
> sDocId etc are declared as
>
> Dim sDocId  as String in class level...
>
>
> Please go thru it and guide me in right direction...
>
>
> Regards,
>
> Anand
>
> "Zvonko Keber" wrote:
>>Check if you create a new object inside your loop (with "new"), and if
> you
>>do, call it's Dispose every time you're finished with it. Otherwise,
> create
>>the object only once, and dispose it only once. If you need the object
> for
>>future reference, try saving it to disk.
>>
>>
>>"Anand" <an***@trellisys.net> wrote in message
>>news:%23zyd0duBGHA.1180@TK2MSFTNGP09.phx.gbl...
>>> Hello,
>>>
>>>   Thanx for ur reply. All my objects are in a shared class...and that
>>> too shared properties. On looping (say each 10 sec) i assign what all
>>> values i get from database to these variables. (App is something like
>>> displaying alerts if new activity is there).I need those values till
>>> next looping. So i think i cant make it nothing. ...Any performance
>>> problem if i used shared property in my apps. Also any other reason
> for
>>> net memory leak..
>>>
>>> Regards ,
>>>
>>> Anand
>>>
>>>
>>> "Zvonko Keber" wrote:
>>>>SetProcessWorkingSetSize does not solve your memory consumption. It
>>> only
>>>>trims the part of memory that process' once occupied.
>>>>You don't need the SetProcessWorkingSetSize at all.
>>>>
>>>>You are probably watching the "Memory Usage" column in task manager.
>>> You
>>>>should be watching "VM size" column, which is hidden by default. This
>>> is
>>>>your application's allocated private bytes (total amount of memory
>>> allocated
>>>>by the process).
>>>>
>>>>You need to make sure you dispose every object you create. If the
>>> object
>>>>doesn't implement a Dispose method, you should make sure that all
>>> references
>>>>to the object are lost (every time you associate a variable with the
>>> object,
>>>>reference is added and you need to set those variables to Nothing).
>>>>
>>>>
>>>><anandav2***@gmail.com> wrote in message
>>>>news:1135245112.318450.235410@g14g2000cwa.googlegroups.com...
>>>>> Hello developers,
>>>>>
>>>>>   I have created an executable(system tray application) in VS.net
>>> 2003
>>>>> using VB.net. My app was taking 30 MB memory(since some web
> services
>>>>> call are there which happens for each 10 sec checking internet is
>>>>> available or not). Inorder to reduce huge memory consumption, what
> i
>>>>> used is
>>>>>
>>>>> Public Class MemoryManagement
>>>>>    Private Declare Function SetProcessWorkingSetSize Lib
>>>>> "kernel32.dll" ( _
>>>>>              ByVal process As IntPtr, _
>>>>>              ByVal minimumWorkingSetSize As Integer, _
>>>>>              ByVal maximumWorkingSetSize As Integer) As Integer
>>>>>
>>>>>    Public Shared Sub FlushMemory()
>>>>>        GC.Collect()
>>>>>        GC.WaitForPendingFinalizers()
>>>>>        If (Environment.OSVersion.Platform = PlatformID.Win32NT)
> Then
>>>>>
>>>>> SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1,
> -1)
>>>>>        End If
>>>>>    End Sub
>>>>> End Class
>>>>>
>>>>> Now i call FlushMemory on every 10 secs.
>>>>>
>>>>> Now the memory consumption got reduced  to 2 MB..But the problem is
>>>>> after running this application for several days continously(say 1
>>> week)
>>>>> i got .net memory leak exception. I heard that .net memory
> exception
>>>>> comes only if your application doesnot leave memory when other apps
>>>>> need it. Can anyone guide me correctly...
>>>>>
>>>>> Any help in this regard is greatly appreciated......
>>>>>
>>>>> Regards,
>>>>>
>>>>> Anand. A.V
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Sent via .NET Newsgroups
>>> http://www.dotnetnewsgroups.com
>>
>>
>
>
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com
Author
22 Dec 2005 3:00 PM
Anand
Hello zvkeber,

  Thanx for the support what you are giving..

  Think like this..This app is like a messenger(yahoo) which actually
popups ur email alerts. Even if u miss alerts(u may be away) you can see
it later all alerts that have been pop up until you clear it yourself.
SO i cnt think of clearing it...


Also any problem with my code..

Regards,

Anand

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Author
22 Dec 2005 3:34 PM
Zvonko Keber
Once after the user reads the message, your application still holds that in
the memory, right?
Is that necessary?

Show quote
"Anand" <an***@trellisys.net> wrote in message
news:uIcRqhwBGHA.3292@TK2MSFTNGP09.phx.gbl...
> Hello zvkeber,
>
>  Thanx for the support what you are giving..
>
>  Think like this..This app is like a messenger(yahoo) which actually
> popups ur email alerts. Even if u miss alerts(u may be away) you can see
> it later all alerts that have been pop up until you clear it yourself.
> SO i cnt think of clearing it...
>
>
> Also any problem with my code..
>
> Regards,
>
> Anand
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com
Author
22 Dec 2005 3:45 PM
Zvonko Keber
What you also might try is following:
- remove the dsAlerts from the class level, and declare it inside the
Timer's tick event
- dispose the dsAlerts at the end of the tick event

this should do it.

Show quote
"Zvonko Keber" <zvke***@yahoo.com> wrote in message
news:eQIJl0wBGHA.3984@TK2MSFTNGP14.phx.gbl...
> Once after the user reads the message, your application still holds that
> in the memory, right?
> Is that necessary?
>
> "Anand" <an***@trellisys.net> wrote in message
> news:uIcRqhwBGHA.3292@TK2MSFTNGP09.phx.gbl...
>> Hello zvkeber,
>>
>>  Thanx for the support what you are giving..
>>
>>  Think like this..This app is like a messenger(yahoo) which actually
>> popups ur email alerts. Even if u miss alerts(u may be away) you can see
>> it later all alerts that have been pop up until you clear it yourself.
>> SO i cnt think of clearing it...
>>
>>
>> Also any problem with my code..
>>
>> Regards,
>>
>> Anand
>>
>> --
>> Sent via .NET Newsgroups
>> http://www.dotnetnewsgroups.com
>
>
Author
22 Dec 2005 6:54 PM
Jon Skeet [C# MVP]
Anand <an***@trellisys.net> wrote:
>   Thanx for the support what you are giving..
>
>   Think like this..This app is like a messenger(yahoo) which actually
> popups ur email alerts. Even if u miss alerts(u may be away) you can see
> it later all alerts that have been pop up until you clear it yourself.
> SO i cnt think of clearing it...

That doesn't mean you have to store everything in memory. Implementing
a file-based queue isn't particularly tricky, and means you don't have
a potential memory black hole.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

AddThis Social Bookmark Button