I've been stress testing DocumentsWriter by indexing wikipedia, but not
giving enough memory to the JVM, in varying heap sizes to tickle the
different interesting cases. Sometimes DocumentsWriter can deadlock;
other times it will hit a subsequent NPE or AIOOBE or assertion
I've fixed all the cases I've found, and added some more asserts. Now
it just produces plain OOM exceptions. All changes are contained to
All tests pass. I plan to commit in a day or two!