Liquibase generateChangeLog Failed: Java Heap Space

When I try to generate SQL data from a DB2 database, I get a problem with the Java Heap space. There are about 25 tables with approximately 1000 records.

I use the following scripts when creating change set data:

C:\liquibase-3.0.2-bin>liquibase --driver=com.ibm.db2.jcc.DB2Driver \ --classpath="C:\db2jcc.jar" \ --changeLogFile="C:\Liquibase Release\liqui_MYDB_MYSCHEMA_Data.xml" \ --url="jdbc:db2://__ip__here__:9008/MYDB" \ --username="user" \ --password="12345" \ --defaultSchemaName="MYSCHEMA" \ --diffTypes=data \ generateChangeLog 

I tried to increase the memory by setting JAVA_OPTS in the Liquibase.bat file, but this did not give any solution:

  • set JAVA_OPTS="-XX:MaxPermSize=1024m"
  • set JAVA_OPTS="-Xms512m -Xmx1024m"
+4
source share
1 answer

You should not run in MaxPermSize, so you just need to set the larger Xmx flag.

It can also help add the flag --dataOutputDirectory=DIR_YOU_WANT . This will cause Liquibase to output data in CSV files that will be less intensive to create. The resulting XML + CSV is usually more manageable than a large XML file, and

Sort of:

 C:\liquibase-3.0.2-bin>liquibase \ --driver=com.ibm.db2.jcc.DB2Driver \ --classpat h="C:\db2jcc.jar" \ --changeLogFile="C:\Liquibase Release\liqui_MYDB_MYSCHEMA_Data.xml" \ --url="jdbc:db2://__ip__here__:9008/MYDB" \ --username="user" \ --password="12345" \ --defaultSchemaName="MYSCHEMA" \ --diffTypes=data \ --dataOutputDirectory=C:\Liquibase Release\liqui_MYDB_MYSCHEMA_Data.out \ generateChangeLog 
+2
source

Source: https://habr.com/ru/post/1500993/


All Articles