Memory Usage Does not Decrease Unless Manually Minimized...?

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
CallerDude
Posts: 16
Joined: Tue Jul 27, 2010 4:40 pm

Memory Usage Does not Decrease Unless Manually Minimized...?

Post by CallerDude »

Hi, Bill! On the thinclient I am using, I've decided to scrap Explorer.exe and use the Opera web browser as my shell. Ascendis is to run in the background, with the YAC Listener picking up incoming calls and displaying them full screen.

When minimized to the system tray in Windows while using Explorer.exe as the Windows shell, Ascendis uses a paltry amount of memory, maybe 3.5 megs. When a call comes in, the memory increases, but as soon as the caller information disappears, the memory drops right back down. However, when I switched to using Opera.exe as the Windows shell, the memory climbs to over 12 megs, and then, instead of dropping back down once the caller information disappears, it stays high.

Each subsequent call bumps the memory a little bit higher (12.580 megs, 12.632 megs, 12.644 megs etc.) and it does not fall back down like it does under the default Windows shell.

I am using the latest version of Ascendis, and I am starting Ascendis via

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

under "Userinit".

1) Why is it rising each time?
2) Why isn't it falling back down each time?

:-)

~Bryan


EDIT: 6/18/11 9:21 P.M. EDT

I tried a few other experiments. This time, I left Explorer.exe running, and noticed that unless I minimize the program manually, Ascendis does not relinquish the RAM back to the system. For example, if I tell it to run in the system tray and issue a YAC test call, the information pops up on the client, and the memory usage expands to about 12 megs. After the notification window goes away, the memory usage stays there. When I click on the program in the system tray to bring it to the foreground/maximize it and then deliberately minimize it, then the memory usage is returned, and Task Manager shows a reduction back to a meg or so (which is awesome).
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Memory Usage Does not Decrease Unless Manually Minimized

Post by Bill Root »

Hi Bryan,

First, I don't know how Windows calculates the memory used by an application. I can tell you that Ascendis Caller ID doesn't do anything special when minimized. When a call comes in and Ascendis Caller ID shows a notification window, I would expect it to use more memory until the window is closed. That's because showing the window takes memory, and the memory is freed when the window is closed.

It probably doesn't surprise you that Ascendis Caller ID does not differentiate between the Windows Explorer shell, the Opera shell, or any other shell. Ascendis Caller ID has no idea what the shell is.

I suspect that one of two things is happening:
1) The shell program could be responsible for interpreting memory usage by applications. Windows Explorer may discount memory used for windows that are not displayed when an application is minimized.

2) The shell program could be responsible for releasing no-longer-used application memory to the operating system. This seems less likely.

To be clear, Ascendis Caller ID does nothing special to reduce memory usage when minimized. The differences you're seeing with different shells are most likely caused by reporting differences.

Finest regards,
Bill Root
Ascendis Software LLC
CallerDude
Posts: 16
Joined: Tue Jul 27, 2010 4:40 pm

Post by CallerDude »

I tried to show what I see happening in this movie. The shell has not been altered?it is running stock Explorer.exe.

http://www.filedropper.com/test_2

1) First, CallerID.exe is using 1.8 megs of RAM.

2) Next, I issue a YAC test call, and it pops the caller information full screen.

3) Task Manager reports memory usage rising to 11.7 megs, which makes sense, since the program is showing the message on the screen. I close Task Manager, and hit CTRL+ALT+ESCAPE to reopen it. It shows the same 11.7 meg memory usage.

4) Next, I click the Ascendis Caller ID tray icon, and restore the program's main window. Memory rises to 12.1 megs, which makes senses since the main window is open.

5) Finally, I minimize the main window: memory drops back down to an incredible 1.4 megs.

What seems funny is that the memory only drops back down once the program is manually minimized. Is this an error in Task Manager, in that the memory was released as soon as the YAC test call info disappeared, but was not reported as released until the main window was manually minimized?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Memory Usage Does not Decrease Unless Manually Minimized

Post by Bill Root »

CallerDude wrote:What seems funny is that the memory only drops back down once the program is manually minimized. Is this an error in Task Manager, in that the memory was released as soon as the YAC test call info disappeared, but was not reported as released until the main window was manually minimized?
Ascendis Caller ID releases the memory for the notification window when it closes. However, when Ascendis Caller ID releases the memory it's released to the program memory manager, which is FastMM. FastMM decides when to release memory back to Windows. If it does it too soon, subsequent memory allocations are slow.

I'm not a Windows memory expert, but from what I just read it appears that one way Windows manages memory usage for programs is to write the memory "workingset" to disk when programs are minimized. This temporarily decreases the amount of physical memory used by the program, but increases the amount of time it will take for the program to restore. Apparently Windows will do the same thing if the system runs low on memory.

So no, I don't think this is an error in Task Manager. But worrying about this number going up and down depending on whether the program is minimized is not helpful, since the program always "wants" the non-minimized amount. It will take longer to access the memory if Windows has paged it to disk. And, Windows will page it to disk if the system memory becomes low. I suggest letting Windows do its job and try not to worry about it.

Finest regards,
Bill Root
Ascendis Software LLC
CallerDude
Posts: 16
Joined: Tue Jul 27, 2010 4:40 pm

Post by CallerDude »

Thanks, Bill. I love your program, and just wanted to make sure everything was working right. I'll stop worrying about it now.

:-)
Post Reply