Liquibase OutOfMemory

We’re using Liquibase for the database migration. Recently we were doing integration with 23andme genetic application so we had to import some data from it.

We created a file with SQL instructions which contained 22 Mb of scripts. It’s mostly a bulk insert. When trying to execute this script via liquibase we’ve got “OutOfMemory: Java heap space”.

A small profiling session showed that 200Mb of objects were allocated inside:

    protected String prepareSqlForChecksum(String string) {
        string = string.trim();
        string = string.replace("\r\n", "\n").replace("\r", "\n");
        string = string.replaceAll("\\s*\\n\\s*", " ");
        string = string.replaceAll("\\s+", " ");

        return string;

For now we excluded reference to this large script from the changelog.
UPD: CORE-1509 was created to track this problem.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s