Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too much memory allocations #1924

Closed
luengnat opened this issue Feb 13, 2018 · 5 comments
Closed

Too much memory allocations #1924

luengnat opened this issue Feb 13, 2018 · 5 comments

Comments

@luengnat
Copy link

@luengnat luengnat commented Feb 13, 2018

What version of Flyway are you using?

4.X

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

maven

What database are you using (type & version)?

Oracle 12c

What operating system are you using?

Linux

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

We have tons of database to migrate and the migration script is very long. We noticed that the migration spends a lot of time performing GC when we run a lot of data migrations in our integration tests. It turns out that SqlScript class uses a lot of String split, replace, toUpperCase, trim, replaceAll, etc which generates a lot of string garbage. I wonder whether it's possible to stream line them a little bit such as:

  1. Use Pattern/Matcher.replace instead of String.replace which creates a Pattern every time.
  2. Use Matcher.appendReplacement whenever you can
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 13, 2018

Please try again with 5.0.7 as there have been a number of changes in this area.

The streaming part is related to #615 . I'll look into the 2 other suggestions as well.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 20, 2018

Any news?

@luengnat
Copy link
Author

@luengnat luengnat commented Feb 21, 2018

I haven't tried it out yet. Still waiting to move out of 11g.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Mar 14, 2018

We have now rewritten a number of string handling functions and profiling indicates that things are much better now.

axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Mar 14, 2018
@luengnat
Copy link
Author

@luengnat luengnat commented Mar 14, 2018

@axelfontaine I just tried to upgrade to 5.0.7 from 4.2.0, it seems to break our schema deployment. It looks like some of the scripts seem to run twice. I'm trying to track it down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants