Why increase program memory?

when i run program,
i found that this program occupy memory increased about 0.08% every loop

Sounds like a memory leak. I’ll look into it, thanks!

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I work a program using SDL(1.1.5 or cvs-1.1.6) and smpeg(0.4.0 or 0.4.1)
lib
this program include under code

{
SDL_Init

while( i++ < 2000 ){
( add SDL_Init ) <-- Add or Omit
SMPEG_new
SDL_SetVideoMode
SMPEG_setdisplay
SMPEG_play(…)
sleep 3 second
SMPEG_delete
SDL_FreeSurface
( add SDL_Quit ) <-- Add or Omit
}
}

when i run program,
i found that this program occupy memory increased about 0.08% every loop

at first, this program occupied 6% memory in my ram 128M, swap 120M
and when count about 1200
this program occupied 80% in 128M ram, 120M swap

in the end, this program shutdown, X window shutdown

What can I do for this problem?

for reference,
redhat kernel 2.2.16-3
egcs-2.91.66
XFree86-3.3.6

Thanks.