Hi Andrei, The one with the 800MB heap was my initial test case, the 4MB row size was just an example to clarify my problem.
Unfortunately, creating the indexes in an adminstrative mode is not a solution for us. H2 is just used as a temporary database helping us to bring together data from different sources (CSV, XML, different databases, ...), results are compacted and rendered to an excel spreadsheet. When our application terminates, the H2 database is deleted. From: Andrei Tokar <andrei.to...@gmail.com> To: H2 Database <h2-database@googlegroups.com> Date: 23.05.2019 03:16 Subject: Re: [h2] OutOfMemory when creating an Index Sent by: h2-database@googlegroups.com Something does not click here: If you have "a table with millions of rows and an assumed column width of 4MB of data", then how it is possible, that "with set to 1000 the index creation still required a maximum heap of about 800M, but the OOM Error did not occur anymore" ? Your thousand rows should take at least 4G of RAM, not 800M. IMHO, index creation for a big table is an administrative task, presumably performed on idle (if not exclusively held) database, so what would prevent you from opening db with MAX_MEMORY_ROWS of lets say 3000 (assuming 4g heap), creating index, then restart database with you favorite 10, for application to use? On the other hand, we probably should select buffer size as SQRT(ROWCOUNT) and if it exeeds MAX_MEMORY_ROWS/2, then just fall back to plain vanilla r ebuildIndexBuffered(). It might take forever and will trash b-tree, but at least should not fail with OOM. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at https://groups.google.com/group/h2-database. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/212abf4b-e484-4253-92e2-5799166b1ce0%40googlegroups.com . For more options, visit https://groups.google.com/d/optout. ================================================================================================================ Disclaimer The information contained in this e - mail and any attachments ( together the "message") is intended for the addressee only and may contain confidential and/or privileged information. If you have received the message by mistake please delete it and notify the sender and do not copy or distribute it or disclose its contents to anyone. FINARIS Financial Software Partner GmbH, Sömmerringstr. 23, 60322 Frankfurt/Main, Germany Registered at Frankfurt/Main, HRB 52873, Managing Directors: Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl ================================================================================================================ -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at https://groups.google.com/group/h2-database. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/OF3FE305A0.04F50BF5-ONC1258403.00279D38-C1258403.0028939C%40finaris.de. For more options, visit https://groups.google.com/d/optout.