Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-26-2005, 08:43 AM   #1
LQ Newbie
Registered: Oct 2005
Posts: 4

Rep: Reputation: 0
clear or disable file cache


I'm trying different methods to optimize a piece of java-written software. So I've setup some test data and processed it using all the methods I wanted to test. The problem is, I'm using the same data (it's a lot of data, hard to replicate) and all the tests after the first run very quickly (much more quickly than normal).

I figured this might be because Linux caches the files the first time they are accessed, so the second, third... tests don't really read the files.

So I searched everywhere trying to find a way to clear this file cache (or as a last result disable the thing), but so far came out with nothing. Can someone help me out of this predicament?
Old 10-26-2005, 02:17 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Hi, and welcome to LQ!

You can't do either to the best of my knowledge..
The only work-around would be to load other stuff
(e.g. run a huge copy, one that exceeds the machines
physical RAM size) and then re-run your test sequence.

Old 10-27-2005, 03:27 AM   #3
LQ Newbie
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks, that's my best hope, I think...

I tried to do a
Runtime.getRuntime().exec("cat bigfile > /dev/null")
but for whatever reason that takes ages in JAVA. I'm reading a big file with java calls just before each test... the test results are closer to reality now, but I'd still love to have a better method...
Old 11-04-2005, 10:25 AM   #4
LQ Newbie
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
mount and unmount

If ur dat file is in some other partition
May be mounting and unmounting may help



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
clear cache remotely [mozilla] dereko Linux - Software 2 10-11-2005 05:56 AM
Help! Clear web.cache and log files on server DogByte Linux - Newbie 1 09-20-2005 06:51 PM
How do I clear the memory cache on my linux server? robgo777 Linux - Software 2 01-09-2005 01:30 AM
Help me clear ALL dhcp (client) cache! carboncopy Slackware 4 06-28-2004 08:42 AM
Clear cache raysr Linux - Newbie 2 03-26-2004 01:34 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration