AdoptOpenJDK / openjdk-jdk8u

JDK8u mirror from mercurial
http://hg.openjdk.java.net/jdk8u/jdk8u/
GNU General Public License v2.0
373 stars 286 forks source link

avoid unnecessary memory allocation in HttpURLConnection #2

Closed wuhongzhi closed 5 years ago

wuhongzhi commented 5 years ago

check the context-length (may be null in chunked encoding) before invoke Long.parseLong to avoid a large amount of gabage in a bunch of http call.

jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java

karianna commented 5 years ago

@wuhongzhi Please submit this patch in the upstream OpenJDK project at openjdk.java.net