i have a Windows Server 2008 R2 (64bit) running a 64bit installation of Firebird 2.1.4.18393_0 in a 4GB phisical server.
After a while, the task manager show that all memory is used, but the sum of the memory of all process does not stack to the half of the memory. Unfortunally, it's start swapping.
Using RAMMAP, i can see that my entire database file is mapped into the memory. This only occours in windows server 2008 r2 and windows 7 64 bit. i can use firebird 32 or 64bit installations, doesn't matter.
How can i prevent this? Why this only occours in w2k8r2 and w7?
tks in advance
** UPDATE
Aparently, this occours by the use of all memory by the file system cache. The microsoft documentations explain that this WAS a issue in windows xp, 2k3, vista and 2k8, but it was solved in 7 and 2k8r2. also adds that this issue is more common in 64bit hosts. (http://support.microsoft.com/kb/976618)
there are some tools (DynCache, setcache and the Get/SetSystemFileCacheSize system calls from windows API) that allows me to fix a upper limit to the memory usage by the fscache, but the documentation argues that i should not do this in w2k8r2 because it will severely impact on the overall system performance. anyway, i tried, the performance remained the same shit and the use of the page file remained, although there is now more the 1gb of free memory.
Well, problem solved, after all. it was a bit of windows tunning and a bit of firebird tunning.
On the windows side, the setcache really did the trick in keeping the size of the file system cache under control, even with microsoft saying that i would not need this. i've just added a schedule task to run in every boot.
but even after lowering the memory use, my firebird database was still using 12,5% of my dual-quad-core box: 100% of one core, and performance was terrible (30s to select all tuples from a table with just 10 tuples).
after some monitoring with sinática (www.sinatica.com), i've realize that my database was sweeping. so i disable automatic sweep and added another schedule task to do sweeps on a 2-day basis.
Here's an update on the issue (hopefully helpful):
http://dyemanov.blogspot.com.br/2012/03/firebird-vs-windows-file-system-caching.html
This issue can be mitigated by using the Microsoft DynCache tool. This workaround is applicable if you cannot change the FireBird server to a version that does not have the cache bug, for example when using software that requires a discontinued version, or such.
As DynCache is kind of difficult to acquire and properly set up, see instructions on how to use it here: http://sqlblogcasts.com/blogs/grumpyolddba/archive/2009/03/18/x64-memory-problems.aspx
It looks like this will get you headed in the right direction - http://www.firebirdfaq.org/faq333/.