-
Notifications
You must be signed in to change notification settings - Fork 34
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
Memory leak through missing Closeable #666
Comments
@blackwinter @fsteeg how to cope with the idea to have a bug fix in |
Memory leaks appear e.g. in for (int i=0; i<100; i++) {
ETL.main(new String[]{"conf/rpb-test-titel-to-strapi.flux"});
ETL.main(new String[]{"conf/rpb-test-titel-to-lobid.flux"});
System.out.println(i);
} and see how memory consumption increases constantly despite GC operations (these are the green spikes):, resulting in an
Note also the increased performance over time: |
Could you apply the fix locally? Otherwise, we could release from an unpublished branch. Or, as you mentioned, unarchive the repository temporarily. AIUI, you're blocked from upgrading to a newer (combined) release due to hbz/rpb#129, right? |
I don't like that because it is error prone, especially since we move apps to other server atm. Or WDYT @fsteeg ?
AFAIK the github releases are also read only (this is the place where we normally release Metafix).
If nothing speaks against this, this would be my favourite.
yep |
Totally. I just don't know how long this situation would have to be maintained.
Sorry, GitHub Packages is not an option. As I wrote in #577, Maven packages are always scoped to a single repository. This is core now. We could publish from a metafacture-fix branch in core, though. Not pretty, but should work. |
Yes, this is probably the best approach, we would get a regular release where it's expected and where we can always find it in the future. |
As I said, this is not possible due to a limitation in GitHub Packages. |
We can't consume GitHub packages in rpb anyway. I was thinking of a regular tag + release. But even just a tag would be enough, we build a specific version of metafacture-fix anyway. But a release (without publishing packages) would maybe let us find it more easily in the future. |
I see. I assumed that's what you needed because @dr0i was referring to GitHub Packages.
Not sure how important this is, but okay. Let's unarchive metafacture-fix temporarily and backport the fix once it's merged. Just for the record, though: If you're building from source anyway, you can also apply a patch or build from a fork. |
Wait, this would just be a dependency update in metafacture-fix, right? So we'd have to backport the fix in core and release that first. BTW: Do we have an official support/backport policy for older releases? Has this ever been done before? Or only now that we have this exceptional situation? ;) |
We haven't. It just came up as need has arisen.
yes |
But like in metafacture-fix, just a tag would work. We can build the core tag, then the fix tag, and depend on the fix version. |
But then metafacture-fix would still use the unfixed core version, wouldn't it? Can metafacture-fix consume a tag as a dependency in your setup? |
Only if we build a release of Metafix. (building MF locally, consume that local build in Metafix and make a release). However: |
You can't release a version of metafacture-fix that depends on an unreleased version of metafacture-core. Nobody could use it because the dependency wouldn't resolve.
Are you asking me? I don't really care, TBH. It's an awkward and possibly once-in-a-lifetime situation right now. And as I've said multiple times: We can't release a version of metafacture-fix on GitHub Packages from any repository other than metafacture-core; at least not with the same group ID. |
Nothing against it, but I also think it's more work than needed. Might still be the cleanest approach though.
Right, but we're talking about GitHub releases, not packages (yeah, it's confusing).
So my line of thought is: fix the issue in core, tag as |
right - I mixed a a distribution and depencies here, sorry
Yep. That's what I meant with "a regular bug-fix release (mf core 5.7.1) on maven central and a Metafix 0.7.1 on github releases". |
Well, yes, like I said, that would be fine with me too, but not what I wrote here, which would be just the tags, and building both projects locally (which are then consumed by rpb from the local maven repo). |
Okay, I see. I was indeed confused by the fact that this isn't a release that can be consumed as a dependency, which I thought you needed. And GitHub Releases are typically done for both fix and core. But I understand now.
So in order to consume metafacture-fix In conclusion, do whatever suits your needs. There's probably not going to be anyone else who will reach for this release. |
@fsteeg oh, you are right. These are different things (should go home, too tired to read/understand properly). |
FileMap is not
closeable
for it doesn't implementCloseable
. Thus the resource is not closed when executingcloseStream
(either not in Metamorph nor in Metafix.)As
FileMap
extendsAbstractReadOnlyMap
the latter should implementCloseable
, guaranteeing a treatment of callingclose()
. Same is true for RdfMap.This fixes Memory Leaks we discovered.
The leak appears when a
Fix
is instantiated several times anew within the same JVM. New instantiations happen e.g. in https://github.com/hbz/rpb/ for every single ETLed document (some handfuls per day). It happens in https://github.com/hbz/lobid-resources/ every time its webhook listener is called (regularly once per day). It happens also in https://metafacture.org/playground/ when clicking dozen of time on process having a Fix loading a table.Bug fix should be also made for the last java 1.8 version (metafacture-core 5.7.0 and metafacture-fix 0.7.0) since we rely partly on that version , e.g. in rpb.
We should also blog about the Memory Leak: experiencing, discovering, analyzing, fixing.
The text was updated successfully, but these errors were encountered: