Control memory usage when deleting documents: use idxflushmb as when adding/updating

This commit is contained in:
Jean-Francois Dockes
2011-09-07 19:11:11 +02:00
parent e3532b0941
commit c5ff0cdf52
6 changed files with 65 additions and 16 deletions
+16
View File
@@ -14,12 +14,16 @@
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "autoconfig.h"
#include <stdio.h>
#include <signal.h>
#include <locale.h>
#include <pthread.h>
#include <cstdlib>
#if !defined(PUTENV_ARG_CONST)
#include <string.h>
#endif
#include "debuglog.h"
#include "rclconfig.h"
@@ -96,6 +100,18 @@ RclConfig *recollinit(RclInitFlags flags,
// threads don't try to do it at once).
config->getDefCharset();
int flushmb;
if (config->getConfParam("idxflushmb", &flushmb) && flushmb > 0) {
LOGDEB(("rclinit: idxflushmb=%d, set XAPIAN_FLUSH_THRESHOLD to 10E6\n",
flushmb));
static const char *cp = "XAPIAN_FLUSH_THRESHOLD=1000000";
#ifdef PUTENV_ARG_CONST
::putenv(cp);
#else
::putenv(strdup(cp));
#endif
}
return config;
}