The querying performance drop when running inside OSGI #13785
Comments
The fix in #1503 makes it wrong. The correct solution is to just use throw away isCacheabke. Use a weak map for caching to avoi memleaks created by on the fly created POJOs |
@GreenRover I'd like to get this fix to you sooner, so I've moved this forward to our next patch release after the GA of 3.11. |
@GreenRover: I agree the fix is not great. I might make sense when it was written: as the GetterCache used to have just a class (String) name as a key. This changed a few releases ago and indeed now we can just use weak references to prevents leaks. The possible issue here is a performance regression - this part will require extensive testing. |
@dbrimley thanks for moving this forward. Do you already know the date when the mentioned patch release will be provided? |
@eugeneeer All hands are presently working hard to get 3.11 GA. 3.11.1 should be out around November, of course usual caveats apply around this though and things can change... |
@dbrimley thaks for sheduling this bug. As soon as this is solved and available as nigltly build we would be glad to start testing on our side, to check if our performance problems are gone. |
@dbrimley will it be possible to provide us a nightly build (once it is available) as mentioned by @GreenRover ? |
@eugeneeer yes, we will let you know once it's available |
Are there any news on this issue? Do you have any timeline for it? |
@rweingart @eugeneeer JFYI, I'm working on the fix right now. The fix itself is basically ready, but we have to test its performance, I'm going to do this within next few days. |
Testing a simple query (
Also I have recreated the situation when a class loader, its classes and associated getters are being garbage collected to measure the performance impact:
Looks like the only scenario that may suffer from the new soft cache is performing infrequent queries selecting very few entries under very limited memory conditions. But in that scenario we will have performance problems anyway because of spending too much time doing GC. |
Previously, field and method getters were not cached for classes loaded by a class loader different from the one by which HZ classes were loaded. In a multiple class loaders environment (e.g. OSGi) this caused a slowdown in the full-scan queries execution by about 10 times. This change fixes that by utilizing soft references to simultaneously allow the caching for such classes and their garbage collection. Fixes: hazelcast#13785
Hi, is this issued done? Do you have any information when the release 3.11.1 will be? Or if we can get a nightly build? |
Hi, since the release 3.11.1 is being posponed to the Mid-December we need a nightly build with the fix of this bug. When can you provide it? |
@GreenRover @eugeneeer the PR will be merged within next few days, we will provide you with a nightly build either this week or on the beginning of the next week. |
Previously, field and method getters were not cached for classes loaded by a class loader different from the one by which HZ classes were loaded. In a multiple class loaders environment (e.g. OSGi) this caused a slowdown in the full-scan queries execution by about 10 times. This change fixes that by utilizing soft references to simultaneously allow the caching for such classes and their garbage collection. Fixes: #13785
Previously, field and method getters were not cached for classes loaded by a class loader different from the one by which HZ classes were loaded. In a multiple class loaders environment (e.g. OSGi) this caused a slowdown in the full-scan queries execution by about 10 times. This change fixes that by utilizing soft references to simultaneously allow the caching for such classes and their garbage collection. (cherry-picked from d2f5563) Fixes: hazelcast#13785
Previously, field and method getters were not cached for classes loaded by a class loader different from the one by which HZ classes were loaded. In a multiple class loaders environment (e.g. OSGi) this caused a slowdown in the full-scan queries execution by about 10 times. This change fixes that by utilizing soft references to simultaneously allow the caching for such classes and their garbage collection. (cherry-picked from d2f5563) Fixes: #13785
Previously, field and method getters were not cached for classes loaded by a class loader different from the one by which HZ classes were loaded. In a multiple class loaders environment (e.g. OSGi) this caused a slowdown in the full-scan queries execution by about 10 times. This change fixes that by utilizing soft references to simultaneously allow the caching for such classes and their garbage collection. Fixes: hazelcast#13785
A problem seems to be related to the Java Reflection info caching implemented in
com.hazelcast.query.impl.getters.Extractors
:For OSGi environments the given method will be returning
false
because obviously Hazelcast and the POJOs are in separate bundles, thus having separate class loaders:It looks like this was introduced with this commit as a fix for: #1503
Please reach out to me for more details.
The text was updated successfully, but these errors were encountered: