Login  
Search All Forums
Dart Home | PowerTCP Mail for ActiveX | Custom Development Reply | PowerTCP Mail for ActiveX Topics | Forums   
AuthorForum: PowerTCP Mail for ActiveX
Topic: Memory leak doing Refresh?
User148

Posts: 1
Member Since: 03/30/02
posted March 30, 2002 11:42 PM

I am using the latest version of the PowerTCP IMAP control with Powerbuilder 7.03. In order to evaluate this control set I decided to write a simple 'check for new mail' app. It would connect to the server, build a list of available messages every minute or so, and compare this list to the last list to see if there are any new emails. In doing this I noticed that free memory would continually decrease until the app crashed. So I wrote a program to see what was happening. Here are the results:

Program code:
STEP1: Logon

STEP2: Loop the following 10 times
// Refresh the mailbox list
ole_imap.object.Refresh()

// Refresh the message count for each mailbox
for ll_index = 1 to ole_imap.object.Mailboxes.Count
ole_imap.object.Mailboxes.Item(ll_index).Refresh
next

STEP3: Logoff

Results:
Available Physical Memory

Start:      102,019,072
After loop: 001, 101,896,192 Diff: 000,122,880
After loop: 002, 100,843,520 Diff: 001,052,672
After loop: 003, 099,311,616 Diff: 001,531,904
After loop: 004, 098,697,216 Diff: 000,614,400
After loop: 005, 097,337,344 Diff: 001,359,872
After loop: 006, 096,288,768 Diff: 001,048,576
After loop: 007, 095,809,536 Diff: 000,479,232
After loop: 008, 094,806,016 Diff: 001,003,520
After loop: 009, 093,884,416 Diff: 000,921,600
After loop: 010, 092,770,304 Diff: 001,114,112
End:       092,770,304

Total memory change: 009,248,768

As you can see 9Mb of memory were lost just by doing a mailbox refresh (I have 64 mailboxes, not so huge) on each mailbox 10 times. Even after logginf off the memory is still held, it is not given back to the system until the App is closed.

Am I doing something wrong? Can anyone reproduce this problem?

Thanks for your help,

  Aron Cox.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 1, 2002 11:33 AM


Hi Aron,
Are you sure you are not doing anything else, like writing to a file or creating a trace log?
I just created a very simple VB project (below), but was not able to see the problem with our latest version:
http://www.dart.com/downloads/update.exe
If you use this code, is it different for you?
Thanks,
-ken

Private Sub Command1_Click()
  Command1.Enabled = False
  Dim box As New Mailbox

  Imap1.Login host, user, pass

  Dim x As Integer
  For x = 1 To 200
    Imap1.Refresh

    For Each box In Imap1.Mailboxes
      box.Refresh
    Next
  Next

  Imap1.Logout
  Command1.Enabled = True
End Sub

K M Drake
Dart Tech Support
Reply | PowerTCP Mail for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX