Re: RFR: JDK-8027624 - com/sun/crypto/provider/KeyFactory/TestProviderLeak.java unstable again

2013-10-31 Thread Dan Xu

Hi Bernd,

You are right, Thanks for your suggestion. We already have an 
enhancement logged on this improvement, please see JDK-7176176. I have 
linked it to this bug and commented about it.


-Dan

On 10/31/2013 03:15 PM, Bernd Eckenfels wrote:

Am 31.10.2013, 23:05 Uhr, schrieb Dan Xu :

In the call of SecretKeyFactory.getInstance(), it will try to access
files under temporary directory by calling File.list() method. And this
list() method may consume a lot of memory if there are large amount of
files inside.


You could also consider using File.newDirectoryStream of NIO.2

Gruss
Bernd




Re: RFR: JDK-8027624 - com/sun/crypto/provider/KeyFactory/TestProviderLeak.java unstable again

2013-10-31 Thread Bradford Wetmore

Looks good, thanks for looking at this, Dan!

Brad


On 10/31/2013 3:05 PM, Dan Xu wrote:

Hi All,

Please help review a simple change towards the testcase,
TestProviderLeak.java.

In the call of SecretKeyFactory.getInstance(), it will try to access
files under temporary directory by calling File.list() method. And this
list() method may consume a lot of memory if there are large amount of
files inside. In such case, it will cause OutOfMemory error and fail the
test. As the contents in the tmp directory vary at different time and on
different machines, it leads to the fragility of this test. In the
change, it moves eatupMemory() method close to the testing iteration to
avoid the memory consumption in non-testing codes.

Bug: https://bugs.openjdk.java.net/browse/JDK-8027624
Webrev: http://cr.openjdk.java.net/~dxu/8027624/webrev/


Thanks,

-Dan


Re: RFR: JDK-8027624 - com/sun/crypto/provider/KeyFactory/TestProviderLeak.java unstable again

2013-10-31 Thread Bernd Eckenfels

Am 31.10.2013, 23:05 Uhr, schrieb Dan Xu :

In the call of SecretKeyFactory.getInstance(), it will try to access
files under temporary directory by calling File.list() method. And this
list() method may consume a lot of memory if there are large amount of
files inside.


You could also consider using File.newDirectoryStream of NIO.2

Gruss
Bernd
--
http://bernd.eckenfels.net


RFR: JDK-8027624 - com/sun/crypto/provider/KeyFactory/TestProviderLeak.java unstable again

2013-10-31 Thread Dan Xu

Hi All,

Please help review a simple change towards the testcase, 
TestProviderLeak.java.


In the call of SecretKeyFactory.getInstance(), it will try to access 
files under temporary directory by calling File.list() method. And this 
list() method may consume a lot of memory if there are large amount of 
files inside. In such case, it will cause OutOfMemory error and fail the 
test. As the contents in the tmp directory vary at different time and on 
different machines, it leads to the fragility of this test. In the 
change, it moves eatupMemory() method close to the testing iteration to 
avoid the memory consumption in non-testing codes.


Bug: https://bugs.openjdk.java.net/browse/JDK-8027624
Webrev: http://cr.openjdk.java.net/~dxu/8027624/webrev/ 



Thanks,

-Dan