FilterOutputStream.close() throws exception from flush()

2014-05-02 Thread Bernd Eckenfels
Hello, back in 2011 there was a discussion about the new changed behavior of FilterOutputStream (and BufferedOutputStream) in regards to not anymore swalloging IOExceptions from flush() on this list (thats where I got the subject from). This was generally a very good improvement (and I am glad

Re: How to mount a volume with file owners being nobody?

2014-05-06 Thread Bernd Eckenfels
Nobody is no different than any other user, so your test can be done with any files you dont have write access to. What is a bit different is root-squash, where you are root user, the file system (server) however treats you as not-priveledged. To test this it is best to loop mount nfs. In all

Re: about Selector.select is block ,but jstack thread is runnable

2014-05-08 Thread Bernd Eckenfels
All Code which blocks inside native methods on native objects (like blocking read on file descriptors or sockets, as well as waits on selectors are not blocking with Java concurrency features and therefore (a bit missleading) in RUNABLE state. Greetings Bernd Am 08.05.2014 um 14:55 schrieb

Re: RFR: Faster ZipFile.getEntry()/entries()

2014-05-21 Thread Bernd Eckenfels
Am Wed, 21 May 2014 14:19:13 -0700 schrieb Xueming Shen xueming.s...@oracle.com: And java implementation also brings in the benefits of better memory usage (all memory allocated in java heap), no more expensive jni invocations... Opinion/comments are appreciated. I had ZIP native code

Re: JVM crash when I use google gperftools Non Heap profiler

2014-05-28 Thread Bernd Eckenfels
Hello, ask there: https://groups.google.com/forum/#!forum/google-perftools It is (does not look) related to openjdk core libraries at all. Gruss Bernd schrieb fuyou fuyou...@gmail.com: crash log A fatal error has been detected by the Java Runtime Environment: SIGSEGV (0xb) at

AbstractStringBuilder::append less inlined?

2014-07-03 Thread Bernd Eckenfels
Hello, in Java7 (U51 in this case) I do some testing with print inlining, and I noticed that all possible executions of AbstractStringBuilder::append had been inlined (hot) in thise tests. Opposed to that I see a lot of too big messages for Java 8. I wonder if this is known/intentional? (The

Re: RFR JDK-7186258: InetAddress$Cache should replace currentTimeMillis with nanoTime (+more)

2014-07-09 Thread Bernd Eckenfels
Hello Peter, I think the comments in compareTo() are now superflucious (with 0). Greetings Bernd Am Wed, 02 Jul 2014 13:56:39 +0200 schrieb Peter Levart peter.lev...@gmail.com: Hi, I updated the webrev with first two suggestions from Bernd (expireTime instead of createTime and cacheNanos

AW: Trusted service?

2014-08-13 Thread Bernd Eckenfels
Just a BTW: It would be really cool to have a SPI interface for that, so people who need SRP, CCM or shared secret handshakes (or stuff like NPN?) don't need to use a third party SSL engine. -- http://bernd.eckenfels.net - Ursprüngliche Nachricht - Von: Wang Weijun

Windows executing bat/cmd

2014-10-04 Thread Bernd Eckenfels
Hello, I noticed that MSDN CreateProcess(W) talks about using cmd /c for executing .bat and .cmd files: To run a batch file, you must start the command interpreter; set lpApplicationName to cmd.exe and set lpCommandLine to the following arguments: /c plus the name of the batch file. However the

Re: Windows executing bat/cmd

2014-10-04 Thread Bernd Eckenfels
Am Sat, 04 Oct 2014 18:21:58 -0700 schrieb Alan Bateman alan.bate...@oracle.com: It's for compatibility reasons. There is a lot of code that calls Runtime.exec to run .cmd and .bat scripts. Early versions of the JDK didn't do much validation in this area and just passed the input to the

Re: RFR: 8060130: Simplify the synchronization of defining and getting java.lang.Package

2014-10-12 Thread Bernd Eckenfels
Am Fri, 10 Oct 2014 17:31:41 -0700 schrieb Mandy Chung mandy.ch...@oracle.com: I agree with David that getting Package objects are not performance critical. On the other hand, the code defining/getting Packages is old and deserves some cleanup especially the synchronization part. Hmm.. isnt

Re: RFR: 8022445: fix RMISocketFactory example to avoid using localhost

2013-08-23 Thread Bernd Eckenfels
Alan Bateman alan.bate...@oracle.com: On 22/08/2013 01:58, Stuart Marks wrote: Hi all, Please review this small documentation change to the example I added to RMISocketFactory a couple weeks ago [1]. This change fixes a problem that Bernd Eckenfels pointed out [2] where the interface

Re: hg: jdk8/tl/jdk: 8019853: Break logging and AWT circular dependency

2013-09-05 Thread Bernd Eckenfels
Am 04.09.2013, 16:54 Uhr, schrieb daniel.fu...@oracle.com: URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b3d6953b9829 8019853: Break logging and AWT circular dependency This looks pretty strange:

Re: FilterOutputStream.close() throws exception from flush()

2014-10-19 Thread Bernd Eckenfels
Hello, sorry for coming up with that thread again, but I see that JDK-8042377 is hanging around with no action, and there was not yet any discussion I have seen about why it would be robust to call this IAE. I know there was quite some work done in 2013 to make this self-supression IAE a bit

Re: RFR: 8060130: Simplify the synchronization of defining and getting java.lang.Package

2014-10-21 Thread Bernd Eckenfels
Hello, one thing I wonder - in the old and in the new case there is nothing in definePackage() guaring the parents from getting to know the new package and causing a conflict (as the atomic insert is only on the specific packages table. Are those (parent and system package) immutable? Gruss

Re: RFR JDK-6321472: Add CRC-32C API

2014-10-22 Thread Bernd Eckenfels
Hello, just a question in the default impl: +} else { +byte[] b = new byte[rem]; +buffer.get(b); +update(b, 0, b.length); +} would it be a good idea to actually put a ceiling on the size of the array which is processed at once? Something below

Re: RFR: 8060130: Simplify the synchronization of defining and getting java.lang.Package

2014-10-22 Thread Bernd Eckenfels
Am Wed, 22 Oct 2014 14:56:59 -0700 schrieb Mandy Chung mandy.ch...@oracle.com: I guess your question is related to my comment about two class loaders can define classes in a package of the same name (two different runtime packages). ClassLoader.getPackage(s) assumes there is only one Package

Re: RFR: 8060130: Simplify the synchronization of defining and getting java.lang.Package

2014-10-24 Thread Bernd Eckenfels
Hello Peter, Am Fri, 24 Oct 2014 18:27:38 +0200 schrieb Peter Levart peter.lev...@gmail.com: One option for solving that in a still performant (lockless on hot path) way would be a ConcurrentSet of package names used for the initial decision if the hierachy needs traversed (and why may

ThreadLocal with null initial values - avoid create map and entry?

2014-11-17 Thread Bernd Eckenfels
Hello, while debugging and optimizing some application ThreadLocal code I noticed, that if I not use the initialValue() method for filling a start value, I could often use the null value to shortcut processing. I.e. I would add a object with some state to clean up, but if there is no object, I

Re: ThreadLocal with null initial values - avoid create map and entry?

2014-11-18 Thread Bernd Eckenfels
Am Tue, 18 Nov 2014 11:37:34 + schrieb Tom Hawtin tom.haw...@oracle.com: On 18/11/2014 05:11, Bernd Eckenfels wrote: Unfortunatelly the ThreadLocal#get() will call #setInitialValue() in all cases, and this will in turn call createMap(). setInitialValue() could avoid to call createMap

Re: ThreadLocal with null initial values - avoid create map and entry?

2014-11-18 Thread Bernd Eckenfels
a static) one approch of mine was to delay using set(). But as mentioned below, thats not possible when get() constructs the whole shebang. Gruss Bernd Am Tue, 18 Nov 2014 15:59:19 +0100 schrieb Bernd Eckenfels e...@zusammenkunft.net: Am Tue, 18 Nov 2014 11:37:34 + schrieb Tom Hawtin

Re: ThreadLocal with null initial values - avoid create map and entry?

2014-11-18 Thread Bernd Eckenfels
Am Tue, 18 Nov 2014 15:12:46 + schrieb Chris Hegarty chris.hega...@oracle.com: Interesting idea. If this was to be the case woultn't multiple get() invocations cause multiple initialValue() invocations? I think storing the null is important to obey the initialValue / remove contract,

Re: ThreadLocal with null initial values - avoid create map and entry?

2014-11-18 Thread Bernd Eckenfels
Am Tue, 18 Nov 2014 15:36:09 + schrieb Chris Hegarty chris.hega...@oracle.com: Yes, either the contract has to change, or the empty default implementation of initial value is changed to not return null but INITIAL. Yes, that was my initial thought too, but unfortunately initialValue

Re: Java CountDownLatch.await(timeout) is influenced by changes to System time on Linux

2014-11-20 Thread Bernd Eckenfels
Am Tue, 11 Nov 2014 14:35:01 +0800 schrieb wuwen.55 wuwen...@gmail.com: Thank you! I'm version is 7u55. and upgrade 7u60 test is ok. Cools results! Can you give a few details, what OS is this (Linux?) and how did you set the clock back (date?)? Did you also try to change the (system)

Re: RFR JDK-6321472: Add CRC-32C API

2014-11-21 Thread Bernd Eckenfels
Hello Staffan, short question, the patch currently only adds the algorithm to be used, is it planned/possible to add it as a supported algorithm to any of the compressors or packers or is there no specification for that? Besides that, the bound buffer now looks good. Gruss Bernd Am Fri, 21

Re: Initializing Secure Random (Reprise)

2014-11-24 Thread Bernd Eckenfels
Hello, Crypto API (as used by NativeRandom on windows with SubMSCAPI) would be the right thing to use for a secure high entropy source (and this is actually what is used if you ask SecureRandom for seed bytes). But I guess this is not at all expected/needed for TLR. Having all platform launchers

Re: Library enhancement proposal for copying data from/to Reader/Writer InputStream/OutputStream

2014-11-28 Thread Bernd Eckenfels
Am Fri, 28 Nov 2014 12:09:11 + schrieb Pavel Rappo pavel.ra...@oracle.com: I'm happy with any tool which is capable of usages search. Configured IDE is a good choice. What usage would you actually search in the OpenJDK code base? I think it is not very representative to search for usage

Re: RFR 8060068 : Remove the static initializer block from DriverManager

2014-12-02 Thread Bernd Eckenfels
Hello, just want to add two somewhat related observations: we have a virtual JDBC driver which maps back to an real driver (or to an Pool/Datasource which uses a real driver. This is to allow JDBC URLs to work in different environments with no config. (Thats is not the nices solution, but after

Re: RFR 8060068 : Remove the static initializer block from DriverManager

2014-12-02 Thread Bernd Eckenfels
Hello Mandy and Lance, (sorry, not a full quote for more focused answers, inline) Am Tue, 02 Dec 2014 14:10:06 -0800 schrieb Mandy Chung mandy.ch...@oracle.com: Would you be able to try this patch and see if the deadlocks are reproducible? Lance has been trying to get customers to verify

Re: [PATCH] JDK-8054565: FilterOutputStream.close may throw IOException if called twice and underlying flush or close fails

2014-12-04 Thread Bernd Eckenfels
Hello, also using a stream in a multi threaded way is quite unusual most of the implementations I have seen use a atomic solution. This makes sense considering the fact that especially the close() might be called by a timeout/cleanup/finalizer/timer/shutdown thread. Using a AtomicUpdater would

Re: [PATCH] JDK-8054565: FilterOutputStream.close may throw IOException if called twice and underlying flush or close fails

2014-12-04 Thread Bernd Eckenfels
Am Thu, 4 Dec 2014 23:54:10 + schrieb Pavel Rappo pavel.ra...@oracle.com: Bernd, as far as I understand we are not talking about concurrent-proof solution for the j.i.FilterOutputStream as this class is sure not even thread-safe. It is used very much, also in concurrent context. As I

Re: [PATCH] JDK-8054565: FilterOutputStream.close may throw IOException if called twice and underlying flush or close fails

2014-12-04 Thread Bernd Eckenfels
Am Fri, 5 Dec 2014 11:49:26 +1100 schrieb Nathan Clement nathan.a.clem...@hotmail.com: Hi, My problem is definitely not related to multi-threaded use. The test shows basically the same code that we have in production that experienced the problem. Of course it can be triggered single

Re: Useful message about NullPointerException

2015-01-26 Thread Bernd Eckenfels
Am Wed, 21 Jan 2015 05:45:08 -0700 (MST) schrieb pike pike...@hotmail.com: We frequently see NullPointerException in our logs. It's really a big headache when we see a NullPointerException and it is encapsulated in another exception as we don't know which object is null and it is throwing an

Re: HashMap collision speed (regression 7-8)

2015-01-10 Thread Bernd Eckenfels
Am Sat, 10 Jan 2015 17:00:58 -0800 schrieb Martin Buchholz marti...@google.com: Why not treeify only when trying to insert an element that is instanceof Comparable? That way, we will not attempt to use less efficient treebins when there will be no benefit. This is my thinking as well, one

Charset.lookupViaProviders uses new ServiceLoader instance on each miss.

2015-01-12 Thread Bernd Eckenfels
Hello, I see some strange scalability problem in an application which uses a few exernal Charsets which are provided by ServiceLoader. When I check the code for Charset.forName()/lookup() I can the 2-entry LRU cache for charsets, and if those caches do not find the charset, it will check

Re: HashMap collision speed (regression 7-8)

2015-01-08 Thread Bernd Eckenfels
and no Comparable interface, the red-black tree becomes less performant to search than a simple linked list of Nodes... Regards, Peter On 01/08/2015 08:41 PM, Bernd Eckenfels wrote: Hello Peter, yes it is only keys without an Compareable interface, but they are quite common. I think

Re: RFR 8068730: Increase the precision of the implementation of java.time.Clock.systemUTC()

2015-01-09 Thread Bernd Eckenfels
Hello Daniel, this is good news. I do wonder: is there a plan to make this an intrinsic(+vsyscall on Linux) just like System.currentTimeMillis()? Because using it for high precision timestamps would only make sense if it is similar lightweight. Greetings Bernd Am Fri, 09 Jan 2015 17:56:28

Re: HashMap collision speed (regression 7-8)

2015-01-09 Thread Bernd Eckenfels
4:10 PM, Bernd Eckenfels wrote: Hello Vitaly, the TREEIFY_THRESHOLD in HashMap is 8 (6 for UNTREEIFY). Not sure if there have been benchmarks for this, I dont see an justification in the source comments. There is a comment, that it is expected to waste a factor of two time and space when

Re: Charset.lookupViaProviders uses new ServiceLoader instance on each miss.

2015-01-12 Thread Bernd Eckenfels
Am Mon, 12 Jan 2015 15:31:24 -0800 schrieb Xueming Shen xueming.s...@oracle.com: We do have map based cache in standard and extended charset provider implementation already. The standard version is prehashedmap based, it probably should be fast enough. The extended version is a treemap based,

Re: Charset.lookupViaProviders uses new ServiceLoader instance on each miss.

2015-01-12 Thread Bernd Eckenfels
Hello, I see typical use of ASCII, ISO88591, UTF8 and then the 1-2 platform/filename encodings in case of Windows (ANSI+OEM). That makes at least 5 commonly used ones (not sure about UTF-16((BL)E) internally?). And this hopes, that all charsets are not used by any of their aliases. But of

Re: HashMap collision speed (regression 7-8)

2015-01-13 Thread Bernd Eckenfels
Hello, Windows 7 x64 on Core i7 Q720 (4C/8T/6MB L3, 1,6GHz) 8GB RAM my numbers in the gist are from a notebook, but I plan to repeat my and your benachmark versions on a different machine tomorow (which has less memory pressure), I will report. I was testing single threaded, will see if this

Re: HashMap collision speed (regression 7-8)

2015-01-08 Thread Bernd Eckenfels
function is dirt cheap. Sent from my phone On Jan 8, 2015 6:25 PM, Bernd Eckenfels e...@zusammenkunft.net wrote: Hello Peter, hm not sure what you mean, i was not suggesting the regression is caused by simpler hashCode bits. (do you mean my comment about the removed randomizer

Re: RFR: 8072645: java.util.logging should use java.time to get more precise time stamps

2015-02-13 Thread Bernd Eckenfels
Hello, it is good to see new features beeing used. I wonder what the performance impact is. I think the new accesor is not yet an intrinsic - but on the other hand it seems not so worse. In addition to that the splitting in long+int also takes some additional time. Gruss Bernd Am Fri, 13 Feb

HashMap collision speed (regression 7-8)

2015-01-08 Thread Bernd Eckenfels
Hello, I think it was topic before, but I just wanted to point out, that it is still an topic on the internetz. :) Motivated by a StackOverflow question regarding HashMap performance regression in Java 8 http://stackoverflow.com/questions/27759527/using-java-7-hashmap-in-java-8/27760442 I made

Re: HashMap collision speed (regression 7-8)

2015-01-08 Thread Bernd Eckenfels
measurements. I just want to see if it has any impact. Thanks, Peter On 01/08/2015 05:38 PM, Bernd Eckenfels wrote: Hello, I think it was topic before, but I just wanted to point out, that it is still an topic on the internetz. :) Motivated by a StackOverflow question regarding

Re: Javadoc nit Throwable#getStackTraceElement

2015-03-22 Thread Bernd Eckenfels
AM, Bernd Eckenfels wrote: There is an typo in the javadoc, * @throws IndexOutOfBoundsException if ttindex %lt; 0 || * index gt;= getStackTraceDepth() /tt Maybe using {@code index 0 || index getStackTraceDepth()} would

Javadoc nit Throwable#getStackTraceElement

2015-03-21 Thread Bernd Eckenfels
There is an typo in the javadoc, * @throws IndexOutOfBoundsException if ttindex %lt; 0 || * index gt;= getStackTraceDepth() /tt Maybe using {@code index 0 || index getStackTraceDepth()} would be better here? Gruss Bernd

Re: Unsafe.{get,put}-X-Unaligned; Efficient array comparison intrinsics

2015-03-03 Thread Bernd Eckenfels
Am Tue, 3 Mar 2015 12:48:12 -0800 schrieb John Rose john.r.r...@oracle.com: I'm a little puzzled by the meaning of UseUnalignedAccesses. From a portable point of view, it sounds like the JVM will be using special access operators. But in fact, it is using the normal aligned memory access

Re: RFR [9] Add blocking bulk read to java.io.InputStream

2015-04-23 Thread Bernd Eckenfels
Hello, I would use the already established name readFully(byte[]) and readFully(byte[],int,int) to be consistent with DataInputStream. Gruss Bernd

Re: RFR (XS) 8076759: AbstractStringBuilder.append(...) should ensure enough capacity for the upcoming trivial append calls

2015-05-01 Thread Bernd Eckenfels
Hello, btw just a small - maybe unrelated - observation on stock Java8u40. When benchmarking String.valueOf/Integer.toString/+n with JMH I noticed that the compiler aided concatenation is the fastest, but not for all integer values. I asume this is related with the initial size of the buffer?

Re: Another take on Finalization

2015-06-05 Thread Bernd Eckenfels
Am Fri, 5 Jun 2015 22:11:08 +0100 schrieb Jonathan Payne core-l...@jpayne.net: My problem was that finalization was not being run at all with the G1 collector. The problem that an object is not detected as unreachable and not enqueued into the finalizer queue is not only a G1 problem. When an

Re: JEP 132: More-prompt finalization

2015-06-02 Thread Bernd Eckenfels
Hello, Am Fri, 29 May 2015 12:18:06 +1000 schrieb David Holmes david.hol...@oracle.com: I guess I'm very concerned about the premise that finalization should scale to millions of objects and be performed highly concurrently. I would agree that it is a bad idea to design applications for such

Re: [9] RFR of 8042377: BufferedWriter and FilteredOutputStream.close throw IAE if flush and close throw equal exceptions

2015-06-24 Thread Bernd Eckenfels
Am Wed, 24 Jun 2015 12:04:58 -0700 schrieb Brian Burkhalter brian.burkhal...@oracle.com: Please review at your convenience. Issue:https://bugs.openjdk.java.net/browse/JDK-8042377 Patch:http://cr.openjdk.java.net/~bpb/8042377/webrev.00/ The use of try-with-resources in

ChronoUnit.FOREVER javadoc talks about era

2015-10-12 Thread Bernd Eckenfels
It might be intentional or a copy+paste thing, the javadoc of FOREVER reads: "... The estimated duration of the era is artificially defined as the largest duration supported by Duration." Since this fragment of the sentence is also describing ERA i suspect its a copy+paste problem, it can be

Re: RFR: JDK-8115868: 32-bit JVM failed to start from a large network filesystem

2015-12-15 Thread Bernd Eckenfels
Hello, I always like it when access() is used instead of stat() magic. I noticed that the new ProgramExists in java_md_common.c does not anymore reject directories (which are typically executable). Not sure it this matters or is intentional, it is a change in semantic. Is there an exising typo

Re: Need help to understand TLS behavior

2015-12-14 Thread Bernd Eckenfels
Am Mon, 14 Dec 2015 09:15:55 -0500 schrieb Roger Riggs : > Hi, > > The reaper thread that waits for process exit has minimal stack > requirements, > and if possible should not consume all of the memory for a full stack. > The 32k number is a guess at a small stack. It

Re: JDK 9 RFR of JDK-8136738: InputStream documentation for IOException in skip() is unclear or incorrect

2016-06-03 Thread Bernd Eckenfels
Hello, I think "seeking negatively" is a bad example for an IO problem. For this reason alone I would remove it. It is unclear to me if this is really forbidden in the interface or in any implementation. With FileInputStream skip(-5) works. (I would expect it to throw IllegalArgumentException

Re: RFR: 8153955: java.util.logging.FileHandler can not create file synchronously over 101 access

2016-06-09 Thread Bernd Eckenfels
Hello, I find the "concurrent/synchronous" comment a bit confusing. How about: # Number of attempts to obtain lock file in FileHandler # Implemented by incrementing the %u placeholder as documented # in FileHandler Javadoc In the test I would add a comment "200 raises the default limit of

AW: RFR 8150778: Reduce Throwable.getStackTrace() calls to the JVM

2016-03-12 Thread Bernd Eckenfels
Hello, Regarding “exceptional”: Speeding up stack-walking can greatly help log frameworks (when they are configured to log the callsite). They hopefully do not use Throwables anymore, but I guess the other variants to get the stack traces of the last few frames on the stack still benefit from

Re: RFR: JDK-4347142: Need method to set Password protection toZip entries

2016-03-29 Thread Bernd Eckenfels
Actually I think most use the AE1 (2003) and AE2 (2004) of „recent“ ZIP Archivers, not the legazy PKZip Version. It would be an Option to only Support those (however given the unclear Standardisation in this area i Can understand it does not Show up in sdk Code, there are quite good

Re: JDK 9 proposal: allocating ByteBuffers on heterogeneous memory

2016-04-06 Thread Bernd Eckenfels
Hello Steve, Thank you for addressing all concerns raised in the discussion. For my points: Using BufferSupplier or similar as the interface name can be mixed with class/constructor names which describe the actual type of memory. However yes I agree that “Memory” has the additional benefit

Re: Expecting Integer.valueOf(String) to accept Literal format ...

2016-04-09 Thread Bernd Eckenfels
Hello, actually Integer.decode is used to parse JLS Integers. And its JavaDoc explicitely state that it does not support underscores. I would have changed that method, not the valueOf. I think there are some legit cases where changing the behavior of valueOf can cause problems. It is

AW: JDK 9 proposal: allocating ByteBuffers on heterogeneous memory

2016-03-31 Thread Bernd Eckenfels
Hello, I like the proposal. I wonder if minimal support for requesting “keyed” memory locations should already be present. The absolute minimum here would be a long (representing any key scheme but of course most natural would be a slot counter or base address) Memory { ByteBuffer

Re: Expecting Integer.valueOf(String) to accept Literal format ...

2016-04-13 Thread Bernd Eckenfels
Am Wed, 13 Apr 2016 13:16:45 -0500 schrieb Paul Benedict : > I think the argument for changing Integer.valueOf(String) hinges on > the belief that the method is meant to parse JLS integer syntax. If > it is, the Javadocs don't speak to that responsibility. If it's an >

Re: java.io.Writer uses CharSequence.toString()

2016-07-29 Thread Bernd Eckenfels
Hello, yes I agree that has to be benchmarked. (And probably greatly varries with the input length as well). But besides the performance aspect I wanted to mention something else. I had a password hashing API and wanted to switch from the typical overwriteable char[] signature to a

Re: Files.read/readAllBytes can loop once with zero size buffer

2016-07-29 Thread Bernd Eckenfels
Hello, BTW: I think accessing named pipes/fifos would have the same "problem". But I guess nobody would use readAllBytes() on them :) Gruss Bernd Am Fri, 29 Jul 2016 21:46:03 +0100 schrieb Alan Bateman : > On 29/07/2016 19:36, Martin Buchholz wrote: > > > I think

Re: Executors enhancement

2016-08-13 Thread Bernd Eckenfels
Hello, yes, an ExecutorService or Executor or ForkJoinPool depending on the minimum requirements you have. As a default you can eithter use ForJoinPool.commonPool() or Executors.newSingleThreadExecutor() or a DirectExecutor() if you dont want to handle the null case special. BTW: little nit, I

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-25 Thread Bernd Eckenfels
 Hallo Brunoais, In the past I die some experiments with non-blocking file channels in the hope to increase throughput in a similiar way then your buffered stream. I also used direct allocated buffers. However my results have not been that encouraging (especially If a upper layer used larger

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Bernd Eckenfels
; Finally, I never, ever compact the read buffer. It requires doing a >>> memcopy which is definitely not necessary. >>> >>> Anyway, those tests about time I made were just to get an order of >>> magnitude about speed difference. I intended to do them differentl

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Bernd Eckenfels
Hello, the NIO2 code for files is pretty disappointing as it does not use file completion ports on Windows or AIO on Linux. You use the file channel, in that case it is blocking. It does not implement SelectableChannel. AsyncFileChannel uses Java threads in the background for the completion

Re: [9] RFR 8170769: Provide a simple hexdump facility for binary data

2016-12-10 Thread Bernd Eckenfels
Hello, i would agree that a hexdumper is too specific for java.base module. But what about hex encoding and parsing (similiar to java.util.Base64. Since java.xml.bind is no longer in the base modules an alternative for DataTypeConverter in SE is missing. Gruss Bernd --

Re: RFR 9: 8165641 : Deprecate Object.finalize

2017-03-14 Thread Bernd Eckenfels
The problem with runFinalizers() is that it only executes one additional (second) finalized-queue processing thread. It will not trigger the Gc mechanism needed to actually detect and enqueue the unreachable candidates. So it might help with slow or stalled finalize() calls, but by doing so it

Re: JEP [DRAFT]: Container aware Java

2017-07-17 Thread Bernd Eckenfels
For a virtualized solution you can use the normal methods for getting the number of virtual CPUs or the RAM size (and I am quite sure nobody expects auto tuning based on host resources). JVM already does that. This fails for soft partitioning, especially cgroups, CPU sets (and NUMA Zones). I

Re: RFR 8080225: FileInputStream cleanup should be improved

2017-09-29 Thread Bernd Eckenfels
Hello, if UnreferencedRAFClosesFd.java is supposed to test the behavior of unreachable ˋrafˋ I wonder how it works as it hold on raf with a reachabilityFence at the end of the main method? Maybe that asks for an explanative comment? Gruss Bernd -- http://bernd.eckenfels.net

Re: RFR [10]: 8185362: Replace use of AtomicReferenceFieldUpdater from BufferedInputStream with Unsafe

2017-08-21 Thread Bernd Eckenfels
I would add a comment to Unsafe why it is used (instead of AtomicUpdater) maybe pointing to the startup benchmark which shows the improved footprint? After all adding Unsafe is might trigger somebody to clean it up in the next release... // we use Unsafe instead of AtomicReferenceUpdater as it

Re: Collections.emptyList().sort() does nothing

2017-11-14 Thread Bernd Eckenfels
I would however vote for allowing an empty list to be sorted. This is such a common case to return a replacement empty list that it will not only introduce changed behavior but also forces ugly code. For singleton list I can kind of understand that you want to fail early, but it could be made

Re: Require some insight regarding Objects & Json

2017-11-12 Thread Bernd Eckenfels
Hello, the Java Objects will occupy more (especially If the Parser does not provide a way to merge same-string-content objects. It depends on the Parser what is converted (but I am not Aware of any which Support Enumerations out of the box, especially since JSON-P JSR is limited to generic

Re: [Patch][JDK10] Use Class.getPackageName() where possible

2017-11-03 Thread Bernd Eckenfels
The private static helper in ObjectStreamClass became a oneliner and can be removed and the callsites can transform from getPackageName(c) to c.getPackageName(). Gruss Bernd -- http://bernd.eckenfels.net _ From: mandy chung

Re: RFR(s): 8060192: Add default method Collection.toArray(generator)

2017-12-05 Thread Bernd Eckenfels
Should the test also check for the case the generator returns under- and oversized arrays? The default impl looks less efficient than (new T[0]), should it really be removed as a major Javadoc example? (Or maybe add more specific implementations besides ArrayList?) Gruss Bernd --

Re: parallel IO anomaly with windows REFS formatted drive

2017-10-29 Thread Bernd Eckenfels
Just a FYI, I would not worry too much about this, Microsoft removed the ability to create ReFS volumes in Win 10 1710 as they seem to only want to support it with Servers and the new Workstation SKUs. Wouldn't it be enough to put a warning into the release notes? However it is again and again

Re: RFR(m): 8177290 add copy factory methods for unmodifiable List, Set, Map

2017-10-31 Thread Bernd Eckenfels
Having a List.of(List) copy constructor would save an additional array copy in the collector Which uses (List)List.of(list.toArray()) Gruss Bernd -- http://bernd.eckenfels.net From: core-libs-dev on behalf of Stuart

Re: RFR(JDK11/NIO) 8202285: (fs) Add a method to Files for comparing file contents

2018-04-27 Thread Bernd Eckenfels
If this really stays this way and reads all bytes into memory it should at least state so, as this can easily overflow heap. Besides the Javadoc is pretty specific but fails to mention the size comparison. Greetings Bernd Gruss Bernd -- http://bernd.eckenfels.net

Better Launchers for Jlink images

2018-05-10 Thread Bernd Eckenfels
Hello, (I noticed changes to the Tests to remove FX Launcher have been discussed here. So Maybe it is the Right list to ask: are there plans to provide better launchers (especially for Windows) with Jlink?) The Java packager/FX have binaries which are a bit better to use as launhers than the

Re: RFR 8204310 : Simpler RandomAccessFile.setLength() on Windows

2018-06-11 Thread Bernd Eckenfels
We had BTW problems (on Windows) with SMB hosted files where appending causes sometimes the filepointer to not increase. We fixed that by closing the file in such conditions. It does however look like a smb Cache and not

jlink / jmods version compatibiltiy

2018-06-01 Thread Bernd Eckenfels
Hello, I am not sure what the Policy for backward/Forward compatibility for JMOD files is, but when I use JDK-9.0.4 jlink on 11ea JMODs I get a IllegalArgumentException and „error reading“ by JDK-10.0.1 with no further Details. If the JMOD files require newer jlink, should they have a Version

Re: RFC: Add new JCA provider to support hardware RNGs

2018-06-20 Thread Bernd Eckenfels
Just a FYI under Linux when you read from urandom the Linux kernel will always XOR with random bytes generated with x64 rdrand instruction (arch_get_random_lomg() - if supported). Since it is a XOR it does not have to trust the quality of this black box hardware implementation. I would not

Re: [PATCH] Prefer TMPDIR over hard coded /tmp

2018-04-25 Thread Bernd Eckenfels
Hello. For robustness reasons, should it maybe fall back to the hardcoded default if the target path does not exist or has the (obvious*) missing write permission? Gruss Bernd * with or without trying a actual write? -- http://bernd.eckenfels.net _ From: Brian

Re: [PATCH] RFR Bug-pending: Enable Hotspot to Track Native MemoryUsage for Direct Byte Buffers

2018-02-14 Thread Bernd Eckenfels
Maybe instead adding a „allocation request type“ argment to allocate Memory? (and wrap it with a typed allocator in the buffer interfacessomewhere?) the „DBB“ part Looks especially cryptic. We have similiar concepts for NMT in the native Code. Besides I mentioned a while back that the JMX

Re: Oracle Java 8u161 regression in XML Schema Factory

2018-02-21 Thread Bernd Eckenfels
Hallo Christoph, Yes the Tests fail with -Djdk.xml.overrideDefaultParser=true (and false) as well. Gruss Bernd -- http://bernd.eckenfels.net Von: Langer, Christoph Gesendet: Mittwoch, 21. Februar 2018 16:16 An: Bernd; OpenJDK Dev list; huizhe.w...@oracle.com Betreff: RE: Oracle Java 8u161

Re: Adding SocketChannel toString to connection exception messages

2017-12-22 Thread Bernd Eckenfels
Hello, I also dearly miss Socket addresses in connection exceptions, however it looks like it is not going to make it. However if we add a getter for the Peer address (not included in toString) then logging frameworks could detect instances of ConnectException and process them accordingly.

Re: free(): corrupted unsorted chunks

2018-06-21 Thread Bernd Eckenfels
Are you using any native libraries in this VM, is there a hs_err or System core file? Can you run „ldd“ on the java launcher binary. Can you try a OpenJDK binary distribution independent of the OS compiled version? Gruss Bernd -- http://bernd.eckenfels.net From:

List Windows FileStores misses named mounts

2018-07-28 Thread Bernd Eckenfels
Hello, I noticed that fs.getRootDirectories() or fs.getFileStores() on Windows only list the Windows drives, but not other disks mounted on a path. When I do the following I actually do get a FileStore for a Name-mounted FS: FileSystem fs = FileSystems.getDefault(); Iterable

Re: Draft JEP proposal: JDK-8200758: Packaging Tool

2018-07-25 Thread Bernd Eckenfels
Hello, Will there be: - support for displaying and asking for acceptance of license text - asking for target directory (installing outside of programfiles) - starting optional post-Installation class - menu entries - user vs. System wide Installation (on windows) - the new launchers also be

Re: Removing the Barrier

2018-08-15 Thread Bernd Eckenfels
You can remove all comments you like. If you do not distribute the resulting binaries you do not need to provide the changes/source you made (that’s a legal requirement from the GPL license). If you do need to provide source (because you distribute binaries) then you have to retain at least all

(XS) java.logging Level.java minor cleanups

2018-08-11 Thread Bernd Eckenfels
Hello, while investigating a Memory leak fix from IBM (IJ05380 is in 8.0.5.20 but not in 8u yet) I noticed that the (fixed) code registerWithClassLoader(Level) in the master queries a unused class name (pn) and it can use the method reference instead of Lambda. See patch below. There seems to

Re: C files and their Mapping(s)

2018-08-11 Thread Bernd Eckenfels
If a Java class from does not use native Methods then no corresponding native implementation is existing/needed (with the Special exception of intrinsics). Most of the JCL is purely Java. What is it you want to modify? Gruss Bernd -- http://bernd.eckenfels.net Von: mr rupplin Gesendet:

File Attributes from DirectoryStream (WindowsPathWithAttributes)?

2018-08-10 Thread Bernd Eckenfels
Hello, in sun.nio.fs.WindowsDirectoryStream I see that the code which iterates the Directory goes to some length to retain the file attributes returned from that function (by attaching them to a WindowsPathWithAttributes (aka BasicFileAttributesHolder). And indeed I can see that class in my

Re: (XS) java.logging Level.java minor cleanups

2018-08-23 Thread Bernd Eckenfels
An: Bernd Eckenfels; Daniel Fuchs Cc: core-libs-dev@openjdk.java.net Betreff: Re: (XS) java.logging Level.java minor cleanups On 8/23/18 2:49 PM, Bernd Eckenfels wrote: > > Did you had any opinion on the synthetic accessors as well? : >> BTW: I get a synthetic Accessor warning on

Re: (XS) java.logging Level.java minor cleanups

2018-08-23 Thread Bernd Eckenfels
An: Bernd Eckenfels; core-libs-dev@openjdk.java.net Betreff: Re: (XS) java.logging Level.java minor cleanups Hi Bernd, Good finding! I agree with the proposed cleanup. I am always a bit uneasy of touching these classes as they have a propensity to come back and bite you from behind when you're

Re: [PATCH] JDK-7033681 - Improve the documentation of Arrays.asList

2018-08-29 Thread Bernd Eckenfels
Hello, Not an Reviewer But just wanted to give a short Feedback: I like the new Version it is really helpful. However I wonder if the usage example should be outside of the apinote. Given the existence of List.of() I wonder if you either mention it as a alternative to the example (with

  1   2   >