Path: utzoo!news-server.csri.toronto.edu!rutgers!usc!rpi!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.programmer Subject: Re: The case of the vanishing memory Message-ID: <29032.27dcb506@kuhub.cc.ukans.edu> Date: 12 Mar 91 17:01:26 GMT References: <1991Mar12.070655.1515@zorch.SF-Bay.ORG> Organization: University of Kansas Academic Computing Services Lines: 62 In article <1991Mar12.070655.1515@zorch.SF-Bay.ORG>, mike@zorch.SF-Bay.ORG (Mike Smithwick) writes: > ["Share and enjoy! Share and enjoy! Our plastic girls and plastic boys!"] > > I have noticed that when I open a window, then procede to create an event in > said window (MOUSEMOVE, clicking on a gadget, etc), sometimes I'll > loose 56 bytes, sometimes. But you get it back when you close the window, right? > Ok, so I assume that this is my IntuiMessage (52 bytes + 4 bytes overhead?). > But it is not consistant. It only happens early in the window's life. I can > generate events like crazy, but after a while, the memory loss will stop. Yes, that's correct... > This is very sporadic, and the events that appear to be eating away at > the memory still get through for me to process and reply to. So its not > like I am ignoring them or anything, but it does seem to have something > to do with how quickly I can get to process them. Very good... > This only happens on my slow (read 68000) machines. On my 020 A1000 and > A3000 it doesn't happen. Your catching on... > So anybody have any idears? Yes. Intuition maintains a list of IntuiMsgs allocated for each IDCMP port. When Intuition needs a message, it checks this list. If one is available, it uses it, otherwise it turns around and allocates it from the system, then sends it. When you finally reply a msg, Intition does NOT return it to the system, it tacks it onto the free list of msgs. When the IDCMP port finally goes away (via CloseWindow() or ModifyIDCMP(xx,NULL) ), Intuition releases the messages. So, as long as you fall behind processing the messages, Intuition will keep grabbing memory from the system for more msgs. Eventually, the pool gets to the point where there are enough msgs and it mostly quits running out. On faster machines, you program gets more done, and processes the msgs faster, so the backlog stays a lot shorter. There is no way to prevent Intuition from doing this, but for most cases you won't use enough messages to gobble enough memory to cause problems. The exception is things like FOLLOWMOUSE which can create massive amounts msgs very quickly. In general the best be is to rip through messages as quickly as possible. Dont be afraid to use ModifyIDCMP() to shut off some messages if your going to go off into space for a while. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum Only... \ Good Cheer !!! Academic Computing Services /// \___________________________ University of Kansas /// /| __ _ Bix: mgooderum \\\ /// /__| |\/| | | _ /_\ makes it Bitnet: MARKV@UKANVAX \/\/ / | | | | |__| / \ possible... Internet: markv@kuhub.cc.ukans.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~