I think you have to ask this on the mkgmap mailing list, this is getting too complicated Out of memory, maybe helps setting java xms or xmx settings lower or higher?
java -Xms1500m -Xmx1500m -ea -jar etc