Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.programmer Subject: Re: The case of the vanishing memory Message-ID: <19775@cbmvax.commodore.com> Date: 12 Mar 91 16:36:25 GMT References: <1991Mar12.070655.1515@zorch.SF-Bay.ORG> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 33 In article <1991Mar12.070655.1515@zorch.SF-Bay.ORG> mike@zorch.SF-Bay.ORG (Mike Smithwick) writes: >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. > >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. Intuition allocates messages as needed, though it will always re-use any messages you've already replied to it. Those messages get freed at CloseWindow() time. Thus, you will appear to lose 56 byte chunks until a bunch (perhaps a half-dozen or a dozen) are allocated. After that, you start to have enough for most circumstances, and only under heavy load will another be allocated. Remember, you get it all back when you close the window. >This only happens on my slow (read 68000) machines. On my 020 A1000 and >A3000 it doesn't happen. Intuition's messages are paced to things like the vblank timer. A faster CPU allows your application to reply messages faster, keeping the queue down. >Mike Smithwick - ames!zorch!mike Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "If all you have is a hammer, everything looks like a nail."