My program eats up a lot of memory!
Posted on 2003-11-08
I made a small MiniWMPlayer, which is just running off the notification icon and has a WMPlayer OCX object within it.
I open my Task Manager, look up my program while it's running and playing a song, I find it's taking about 38,000K of memory usage. I run the regular Windows Media Player, I play a song, and I compare its memory usage, it only takes 5,000K! I was amazed.
Can someone help me go through the objects I have and methods I use?
Let's start with the object I have on the forms.
- 2 Form (1 frmMain for seeking/buttons/etc., 1 frmLabel to animate the song info)
- 1 NotifyIcon
- 5 Timer on frmMain; here's a list of their names and what they do:
tim = to run only once to hide frmMain at startup after 5 seconds
timLoop = loops to see if a newer instance of the app sends a new file name to this current instance (to avoid multiple instances)
timDur = to update the Duration info of the song on frmMain
timback, timforward = used to animate the main window back and forth when the user requests it to show
- 3 Timer on frmLabel; all used to animate the song info back and forth and a pause in the middle
- 1 ContextMenu
- 1 OpenFileDialog
Having that said, do they affect the memory usage at all?