How do I know the memory size of my RAMDirectory ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I know the memory size of my RAMDirectory ?

Ariel Isaac Romero Cartaya
 Hi every body:

How do I know the memory size of my RAMDirectory ?
I need to control the memory size of my RAM directory to serialized the
index to disk when ram directory memory get the 100 MB size.
I have a distributed enviroment
I really need to find the way, I must control the size of the index in RAM
memory.
Please, Could you help me ???

Ariel
Reply | Threaded
Open this post in threaded view
|

Re: How do I know the memory size of my RAMDirectory ?

mark harwood
public int getRAMSize(RAMDirectory ramDir) throws
IOException
{
        String []segs=ramDir.list();
        int totalSize=0;
        for(int i=0;i<segs.length;i++)
        {
                totalSize+=ramDir.fileLength(segs[i]);
        }
        return totalSize;
}


               
___________________________________________________________
Switch an email account to Yahoo! Mail, you could win FIFA World Cup tickets. http://uk.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]