You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "MrChang0 (via GitHub)" <gi...@apache.org> on 2024/05/14 06:09:09 UTC
[I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
MrChang0 opened a new issue, #1632:
URL: https://github.com/apache/incubator-fury/issues/1632
## Is your feature request related to a problem? Please describe.
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
classLoaderFuryPooledCache with `weakKeys`,`softValues`,`expireAfterAccess` , values removed too frequently. In some case it will create too much fury.
## Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
I'd like to remove `softValues` options.
## Additional context
<!-- Add any other context or screenshots about the feature request here. -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2111599586
The value may have strong reference to key, so the key are always strong reachable, and it' will never be taken as weak. The thing here is that Fury will hold strong reference to classes of user objects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2111634814
I see
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2111909903
It is a simple way and users mostly time need't to take this method.
if for may way, I'd like clear `Fury#ClassLoader`, set ClassLoader when `gerFury()` and clear classLoader when `returnFury()`. :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2109815209
Maybe we can resolve this in another way. Like let users call Fury to clear classes explicitly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2112149225
> It is a simple way and users mostly time need't to take this method. if for may way, I'd like clear `Fury#ClassLoader`, set ClassLoader when `gerFury()` and clear classLoader when `returnFury()`. :)
The thing is that Fury itself doesn't support change classloader currently, so we use a map to switch classloaders. Different classloader may have class with same name but different fields. So Fury made the classloader inmutable for simplicity.
But in the long run, it would be great if we can allow update classloader on Fury itself without introducing extra performance overhead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2110245478
> > > If we remove it, those classes will never be collected. In some hot-loading classes scenarios, it will may cause class leak
> >
> >
> > I see it could be just remain `weakKeys`, `softValues` will cause that fury must create again when after gc.
>
> The values can have strong references to keys. If value are not soft references, the weak key won't make the classes eligible for gc. If we remove soft values. The weak keys should be removed too
I'd like think whether `softValue` or not will not effect `weakKeys`. `weakKeys` will take key reference as `WeakEntry`, and won't effected be valueReference. maybe we can take a test for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2110065745
> > If we remove it, those classes will never be collected. In some hot-loading classes scenarios, it will may cause class leak
>
> I see it could be just remain `weakKeys`, `softValues` will cause that fury must create again when after gc.
The values can have strong references to keys. If value are not soft references, the weak key won't make the classes eligible for gc. If we remove soft values. The weak keys should be removed too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2110022102
> If we remove it, those classes will never be collected. In some hot-loading classes scenarios, it will may cause class leak
I see it could be just remain `weakKeys`, `softValues ` will cause that fury must create again when after gc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang closed issue #1632: [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues
URL: https://github.com/apache/incubator-fury/issues/1632
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2109813642
If we remove it, those classes will never be collected. In some hot-loading classes scenarios, it will may cause class leak
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2111676142
How about removing weakkeys & soft values, we can make `org.apache.fury.util.LoaderBinding#clearClassLoader` as a method in `ThreadSafeFury`, and let users to clear classloader explicitly. Then we can remove all weak/soft values in Fury.
The weak/soft values in `CodeGenerator` should still be preserved, since it's a static global state
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [I] [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues [incubator-fury]
Posted by "MrChang0 (via GitHub)" <gi...@apache.org>.
MrChang0 commented on issue #1632:
URL: https://github.com/apache/incubator-fury/issues/1632#issuecomment-2118880766
just like
```java
@Test
public void testCache() throws InterruptedException {
Cache<String, String> cache = CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(1)).build();
cache.put("1", "1");
cache.put("2", "2");
Assert.assertEquals(cache.size(), 2);
Thread.sleep(800);
cache.getIfPresent("1");
cache.cleanUp();
Assert.assertEquals(cache.size(), 2);
Thread.sleep(800);
cache.getIfPresent("1");
Assert.assertEquals(cache.size(), 2);
Thread.sleep(800);
cache.getIfPresent("1");
Assert.assertEquals(cache.size(), 2);
cache.cleanUp();
Assert.assertEquals(cache.size(), 1);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org