vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi Nicholas So is there a way to release the file cache ?. We did another test using a AIX 4.3 box, to allocate some memory then read a large file. First the system, allocated large chunk of memory. Then the file was read. Now the system does not have enough space to put the file to RAM. So what it did was put some part of the memory used for process in page file and read the file in to RAM. Finally the system did not had enough Virtual memory to fork other processes. What would be your suggestion. -- Posted via http://dbforums.com |
| ||||
| Warna wrote: > Hi Nicholas > > So is there a way to release the file cache ?. There is no need to release the file cache. The file cache automatically surrenders whatever memory is required whenever a program requests a memory allocation. > > We did another test using a AIX 4.3 box, to allocate some memory then > read a large file. First the system, allocated large chunk of memory. > Then the file was read. Now the system does not have enough space to put > the file to RAM. So what it did was put some part of the memory used for > process in page file and read the file in to RAM. Finally the system did > not had enough Virtual memory to fork other processes. Well, if your program allocates memory without limit, you'll run out of memory, yeah, whether it's being used to store a file you're reading or whatever. But that's not a file cache problem, that's a program problem. Note that since AIX does "lazy" memory allocation, you don't actually start using actual memory when you run the malloc(), but rather the first time you access that memory. So everything was fine until you wrote enough of that file to memory to fill up your RAM; that's not the file cache, that's YOU grabbing all the memory on the system. > > What would be your suggestion. Don't write programs that allocate memory without limit, and don't worry about the memory being "used" by the file cache. My suggestion for watching your memory load is vmstat. The page out (po) stat indicates how much you system is having write pages out to swap to make room for something else. Ideally, it should be 0; if it is, you have no memory problems. As far as detecting memory leaks in your code, if your leak detection utilities say you don't have any, then you probably don't have any. In any case, there is no such thing in AIX, or any UNIX, as a memory leak that persists after the process has finished. This ain't Windows; you always get all the memory back. Chris Mattern |