Advertisement

Swap memory file

Started by October 02, 2001 12:25 PM
6 comments, last by Ernest 23 years, 4 months ago
What to do if win386.swp grows more as you would expect because of OpenGL game? It is almost 300 Mb big (more than 200 Mb more than before) when i exit from my game, i think this is to much.
Perhaps the game has a memory leak.
Normally, you don''t need to worry about the swapfile and all the stuff Windows is doing behind the scenes, but if you see a drastic change in size like that, there''s a good chance something''s wrong.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
Yes, but what? Problem is on computers, which don''t have enough disk space, because game crashes.
Are you using Win98 ? The Win98 memory management system is extremly bugged, and sudden swapfile growth isn''t that uncommon. You should perhaps try Win2k.
Yes, I am. Any solution beside changing to Win2k?
1) double check your code, if there''s no memory leak.
2) Rewrite Win98''s buggy memory management system
3) if 2 isn''t feasable: live with it, or get a good OS (Win2k or Linux)
Advertisement
How can i find memory leak? I''m not a big expert for C++ or OpenGL, or any programming yet.
Well, that''s not that easy. There are a few basic considerations to take: make sure that for any given malloc() you call a free() and for every ''new'' a ''delete''. Unfortunately, there are many more potential memory leaks, especially if you''re using the Win, GDI or DirectX API. Some Windows API calls themselves leak. All in all, a Win98 system leaks so much, that the water drops already come out of the screen...
You should perhaps try to run your app on something more stable (eg. Win2k, but *not* WinMe, this one is even worse), and check the swapfile behaviour.
How much memory are you allocating in your game ? And how much RAM do you have ? If there''s a big disproportion there, then it'' likely to be a bug in your game (say you have 256MB RAM, allocating only 64MB, but the swapfile grows...). But as I said, don''t try this on Win98, memory management is just to bad.

This topic is closed to new replies.

Advertisement