Subject: NTFS, MSDOSFS and others consume too much memory?
To: None <>
From: Pavel Cahyna <>
List: tech-kern
Date: 06/15/2004 21:14:28

I recently compiled the 2.0_BETA kernel with 'options KMEMSTATS' and ran
'vmstat -m'. Some entries caught my attention:

Memory statistics by type                           Type  Kern
         Type  InUse MemUse HighUse  Limit Requests Limit Limit Size(s)
     UFS quota     1   512K   1024K 19601K        5    0     0  32768,524288
      inodedep     1   512K   1024K 19601K        3    0     0  32768,524288
       pagedep     1    64K    128K 19601K        3    0     0  8192,65536
   NTFS nthash     1   512K    544K 19601K        2    0     0  32768,524288
      NFS node     1   512K    544K 19601K        2    0     0  32768,524288
 MSDOSFS mount     1   256K    272K 19601K        3    0     0  512,16384,262144
   ISOFS mount     1   512K    544K 19601K        2    0     0  32768,524288

Memory totals:  In Use    Free    Requests
                 5258K    175K       34079

Please, do I understand correctly that hundreds of kilobytes of kernel
memory are allocated to NTFS, MSDOS, ISOFS and NFS structures? If I do,
why is it so? I haven't mounted any of those filesystems. (One possible
exception is that while mounting the root filesystem, many filesystem
types are tried until the correct one (ffs) is found.) Also, what are
those large data structures? I looked at struct msdosfsmount (in
src/sys/fs/msdosfs) and while it is large, it does not seem to take 1/4
Mbyte. (gdb prints 420 for sizeof (struct msdosfsmount)).

Also, I do not use quotas, but there is one 'UFS quota' structure taking
512K. Why?

I have 128 MB of physical RAM, but I guess those numbers would be same
for a machine with small memory, where it could be harmful, am I right?

Please, could somebody tell me if this is a real bug or I just don't
interpret the output correctly?

Thanks Pavel