You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ariel Isaac Romero <is...@gmail.com> on 2006/05/09 17:37:55 UTC

How do I know the memory size of my RAMDirectory ?

 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

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

Posted by mark harwood <ma...@yahoo.co.uk>.
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org