makes programs use Less memory in Ram lazarus / 13-General ---------------------------------------------------------------------- The_Genaro · 2010-01-21 01:46 Hello everybody!!! Sorry my english, is not good  Im make a game usin SDL and pascal (i use lazarus...of course) actually the program display only 2 image: a aircraft (aircraft.bmp) and the background (is bmp too) (800x600, 16, windowed). and user can move the aircraft whit directional keys. the problem is that: the program use 8 mb in ram!!! damm!! whats happening when load the rest things!!!!! (bullet, explosions, enemies...) is soo much..i think. im program in "pure mode" not use objects and forms. what can i do for my program use less memory in ram?? thanks!! ---------------------------------------------------------------------- Ñuño_Martínez · 2010-01-21 12:48 Quote from: The_Genaro on January 21, 2010, 02:46:25 amthe problem is that: the program use 8 mb in ram!!! damm!! whats happening when load the rest things!!!!! (bullet, explosions, enemies...) is soo much..i think. That's normal. May be your program need less memory if you deactivate all debug and profile options before compile. I never used SDL but note that it needs to load all SDL dynamic libraries (dll, so, dylib...) and also OpenGL or DirectX dynamic libraries. It loads the whole thing despite if you're not using it. Also most game libraries uses a lot of back-end stuff that needs extra memory. ---------------------------------------------------------------------- José Mejuto · 2010-01-21 16:26 Quote from: The_Genaro on January 21, 2010, 02:46:25 amHello everybody!!! Sorry my english, is not good  Im make a game usin SDL and pascal (i use lazarus...of course) actually the program display only 2 image: a aircraft (aircraft.bmp) and the background (is bmp too) (800x600, 16, windowed). and user can move the aircraft whit directional keys. the problem is that: the program use 8 mb in ram!!! damm!! whats happening when load the rest things!!!!! (bullet, explosions, enemies...) is soo much..i think. im program in "pure mode" not use objects and forms. what can i do for my program use less memory in ram?? thanks!! Hello, Do you think that 8 MB is too much ? Simple calc.exe uses near 4 Mb which is almost the minimun required in a Windows program, now add all the SDL overhead and 1 MB for your graphics and also quite sure SDL will keep a copy of current screen for some kind of double buffering and you get another 1 MB. ---------------------------------------------------------------------- The_Genaro · 2010-01-21 23:22 QuoteThat's normal. May be your program need less memory if you deactivate all debug and profile options before compile. I never used SDL but note that it needs to load all SDL dynamic libraries (dll, so, dylib...) and also OpenGL or DirectX dynamic libraries. It loads the whole thing despite if you're not using it. Also most game libraries uses a lot of back-end stuff that needs extra memory. Ahhh ok...i check debug options and i try again. Thanx Ñuño_Martínez QuoteDo you think that 8 MB is too much ? Simple calc.exe uses near 4 Mb which is almost the minimun required in a Windows program, now add all the SDL overhead and 1 MB for your graphics and also quite sure SDL will keep a copy of current screen for some kind of double buffering and you get another 1 MB. Ok i got it....but de calc is program in Visual C++ (use objects, forms...)....so microsoft programers not much interested in "ligth application"  however, i check SDL overhead...or i find other library  . Thanx JoshyFun Thanx so much for your replays!!! if get another comentary, please say it !! ---------------------------------------------------------------------- Ñuño_Martínez · 2010-01-22 08:31 Quote from: The_Genaro on January 22, 2010, 12:22:27 amhowever, i check SDL overhead...or i find other library  . Can I suggest Allegro.pas? I'm not sure if it has a smaller overhead than SDL and it has a not support for hardware-accelerated graphics in its current status, but I find it easer than SDL. ---------------------------------------------------------------------- Wodzu · 2010-01-22 08:56 Hi The_Genaro, I think that you program will not grow much more when you add another things to it. As others said, it had to allocate some memory at start for all the libraries but then it will not use much more memory. But check it by yourself! Add to the program some other objects and you will see that it will not grow to much. Also, I would suggest you to change from BMP to PNG but the images are probably loaded into GPU memory anyway.