- // Current params: 8 bytes, 15 MB, no samples
- p_->sa = new CSA::RLCSABuilder(8, 0, 15 * 1024 * 1024);
+ // Current params: 8 bytes, no samples, buffer size n/10 bytes.
+ // Buffer size is always at least 15MB:
+ if (estimatedInputLength < TEXTCOLLECTION_DEFAULT_INPUT_LENGTH)
+ estimatedInputLength = TEXTCOLLECTION_DEFAULT_INPUT_LENGTH;
+ p_->sa = new CSA::RLCSABuilder(8, 0, estimatedInputLength/10);