lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi" <ravi.jalada...@siti.com>
Subject Memory Increasing when the optimize is called
Date Tue, 07 Feb 2006 03:34:07 GMT
Hi 

 

 

I have index file around 2GB and when I optimize the index file tomcat is
taking more memory than normal and even after completion of optimization
also it is still taking more memory than the normal memory.. is this way it
will happen or do I need to change any thing to  reduce the memory I am
sending the code for optimization .. Please tell me is there any wrong in
the following code.

 

 

 

 

public  static  void optimizeIndexing() {

                         System.out.println("Index Optitmaization
started....");

                         ERMProperties objProperties
=          new ERMProperties();

                                    String strApplicationDataPath
=          objProperties.getProperty("applicationDataPath");

                                    String strIndexPath
=          strApplicationDataPath + "Index";

                                    File objIndexDir
=          new File(strIndexPath);

                                    boolean bNewIndex
=          false;

                                    IndexWriter indexWriter
=          null;

                                    FSDirectory objFSDirectory
=          null;

                                    try{

                                                if
(!objIndexDir.isDirectory()) {

 
objIndexDir.mkdir();

                                                            bNewIndex
=          true;

                                                }

                                                objFSDirectory
=          FSDirectory.getDirectory(new File(strIndexPath), bNewIndex);

                                                indexWriter
=          new IndexWriter(objFSDirectory, new HLAnalyzer(), bNewIndex);

                                                indexWriter.optimize();

                                    }catch(Exception objException){

                                        objException.printStackTrace();

                                    }finally{

                                                try { if (indexWriter !=
null) indexWriter.close(); } catch( Exception exc) { }

                                                try { if (objFSDirectory !=
null) objFSDirectory.close(); } catch( Exception exc) { }

                                    }

                            

                                    System.out.println("Index Optitmaization
Endeded....");

                        }

 

 

Regards,

Ravi Kumar Jaladanki


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message