Find the answer to your Linux question:
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Jonathan183
Hi, To clear the cache memory, we use the following commands : Flush file system buffers by executing, # sync : what does sync command Do ? Why should we ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2012
    Posts
    110

    What is dentries and Inodes ?


    Hi,

    To clear the cache memory, we use the following commands :

    Flush file system buffers by executing,

    # sync : what does sync command Do ? Why should we use it before using the # echo 1 > /proc/sys/vm/drop_caches ?

    To free page cache:

    # echo 1 > /proc/sys/vm/drop_caches

    To free dentries and inodes:

    # echo 2 > /proc/sys/vm/drop_caches

    To free page cache, dentries and inodes:

    echo 3 > /proc/sys/vm/drop_caches


    What is dentries and Inodes ?


    Can any body explain this Please....?



    Regards,
    Aparna.

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    try here ...
    Lakshmipathi likes this.

  3. #3
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757
    Jonathan183 link should give lot of info. Here is some short info about them.
    # sync : what does sync command Do ?
    sync flushes the buffer into disk.It forces completion of pending disk writes.


    create 10000 files like

    Code:
    mkdir test && for i in {1..10000};do date > test/$i ;done
    Now do
    Code:
    time cat test/*
    Note the sys time.Run the time cat test/* again.Check sys time,is that reduced ? that because of page cache.

    Now drop page cache

    Code:
    # echo 1 > /proc/sys/vm/drop_caches
    Now run time cat test/* again.See its increased.


    Do the similar thing run
    Code:
    time ls -l test
    Note the sys time,run it again ,you should see
    time decreasing.

    Now drop the caches of dentries and inodes:

    Code:
    # echo 2 > /proc/sys/vm/drop_caches
    Run check ls time again.


    cache in general is used for performance optimization.i.e no need to go and fetch the data from hard-disk.It will place the frequently accessed data into physical memory
    itself.

    HTH
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •