silenceshell / hcache

showing top X biggest cache files global
Apache License 2.0
402 stars 97 forks source link

hcache does not show the files which are open by some process and cached in pagecache #35

Open meiq4096 opened 1 year ago

meiq4096 commented 1 year ago

Hcache can't show the files which are opened by some process and cached in pagecache.

# pcstat /data/nvme0n1/oradata/ORAINTEL/EEE54678E49E7CCAE053086EA8C0B9D1/datafile/o1_mf_bmsqlts_krol4w3h_.dbf
|------------------------------------------------------------------------------------------------------+----------------+------------+-----------+---------|
| Name                                                                                                 | Size           | Pages      | Cached    | Percent |
|------------------------------------------------------------------------------------------------------+----------------+------------+-----------+---------|
| /data/nvme0n1/oradata/ORAINTEL/EEE54678E49E7CCAE053086EA8C0B9D1/datafile/o1_mf_bmsqlts_krol4w3h_.dbf | 53687099392    | 13107202   | 12495372  | 095.332 |
|------------------------------------------------------------------------------------------------------+----------------+------------+-----------+---------|

# hcache -top 100 |grep dbf
(none)

I guess the reason is that it gets the files from /proc/{pid}/maps ,not from /proc/{pid}/fd .

I can't get it.

asynchronoust commented 2 weeks ago

i also find this problem. it confused me that the result of hcache does not tell me the season why cache memory is so large.

finally, i found the opend log file use a lot of cache memory. but the hcache does not indicate this.

when i use "hcache xxxfilename", the file is 100% percent cached, the file is opened by process ,but when i hcache -pid, the file does not displayed in the result.