Classloader reuse for <java> tasks

View: New views
3 Messages — Rating Filter:   Alert me  

Classloader reuse for <java> tasks

by lucian chirita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there a way to reuse a classloader across several <java> tasks?  All
the tasks refer the same classpath ID, and have fork="false".

I thought setting ant.reuse.loader would take care of this, but it
doesn't because the <java> task does not use ClasspathUtil to
instantiate classloaders.

Thank you,
Lucian
||

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Classloader reuse for <java> tasks

by Steve Loughran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lucian Chirita wrote:
> Is there a way to reuse a classloader across several <java> tasks?  All
> the tasks refer the same classpath ID, and have fork="false".
>
> I thought setting ant.reuse.loader would take care of this, but it
> doesn't because the <java> task does not use ClasspathUtil to

Java tries to isolate stuff, probably more than you want, to try and
create better isolation and less memory leaks. So no, I dont think you
can do this.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: Classloader reuse for <java> tasks

by lucian chirita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve Loughran wrote:

> Lucian Chirita wrote:
>> Is there a way to reuse a classloader across several <java> tasks?  
>> All the tasks refer the same classpath ID, and have fork="false".
>>
>> I thought setting ant.reuse.loader would take care of this, but it
>> doesn't because the <java> task does not use ClasspathUtil to
>
> Java tries to isolate stuff, probably more than you want, to try and
> create better isolation and less memory leaks. So no, I dont think you
> can do this.
>

That makes sense.

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...