Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / May 2008



Tip: Looking for answers? Try searching our database.

takes a long time to release memory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michaelov, Itzik - 04 May 2008 08:24 GMT
I'm using VB 6.0 SP6
why in second case memory release very slowly

Case 1: (execution time 2 seconds)
Dim mcol As New Collection
Dim k As Collection
For lCount = 1 To 120000
   Set k = New Collection
   mcol.Add k
Next
lCount = mcol.Count
For lIndex = 1 To lCount
      mcol.Remove 1
Next lIndex
Set mcol = Nothing

Case 2: (execution time 30 seconds)
Dim mcol As New Collection
Dim k As Collection
For lCount = 1 To 120000
   Set k = New Collection
   mcol.Add k
Next
lCount = mcol.Count
For lIndex = lCount  To 1 Step -1
      mcol.Remove lIndex
Next lIndex
Set mcol = Nothing

Thanks
Tony Proctor - 04 May 2008 10:24 GMT
Answered in another group!

It's best not to "multi-post" your questions Michaelov. Use "cross-post" if
you want to reach more than one group

   Tony Proctor

> I'm using VB 6.0 SP6
> why in second case memory release very slowly
[quoted text clipped - 25 lines]
>
> Thanks
 
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



©2009 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.