HttpWebRequest connection pooling?

BenDodsonBenDodson USMember ✭✭

At times, our app makes many https connections in a row. We're using HTTP 1.1 with keepalive enabled. I was tracing through the garbage our app is generating to try and get our performance up, and noticed that we're getting a lot of allocations generated in the certificate verification stack (shown below). This got me wondering whether the Xamarin / Monodroid stack is doing connection reuse when making http calls, or whether a connection is being completely torn down?

I/monodroid-gref(12715): handle 0x1d400422; key_handle 0x423b7738: Java Type: mono/android/runtime/InputStreamAdapter; MCW type: Android.Runtime.InputStreamAdapter

I/monodroid-gref(12715): +g+ grefc 87 gwrefc 0 obj-handle 0x1ff00001/L -> new-handle 0x1d50041e/G from at Android.Runtime.JNIEnv.FindClass(System.String classname)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.FindClass(System.Type type)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.NewArray(Android.Runtime.IJavaObject[] array)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.m__B1(System.Array source)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.NewArray(Java.Security.Cert.X509Certificate[] array)
I/monodroid-gref(12715): at Javax.Net.Ssl.IX509TrustManagerInvoker.CheckServerTrusted(Java.Security.Cert.X509Certificate[] chain, System.String authType)
I/monodroid-gref(12715): at Android.Runtime.AndroidEnvironment.TrustEvaluateSsl2(Mono.Security.X509.X509CertificateCollection certs, System.Object sender, System.Security.Cryptography.X509Certificates\
.X509Certificate2 certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, SslPolicyErrors errors)
I/monodroid-gref(12715): at .invoke_bool__this___X509CertificateCollection_object_X509Certificate2_X509Chain_SslPolicyErrors(Mono.Security.X509.X509CertificateColl
I/monodroid-gref(12715): -g- grefc 86 gwrefc 0 handle 0x1d50041e/G from at Android.Runtime.JNIEnv.NewArray(Android.Runtime.IJavaObject[] array)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.m__B1(System.Array source)
I/monodroid-gref(12715): at Android.Runtime.JNIEnv.NewArray(Java.Security.Cert.X509Certificate[] array)
I/monodroid-gref(12715): at Javax.Net.Ssl.IX509TrustManagerInvoker.CheckServerTrusted(Java.Security.Cert.X509Certificate[] chain, System.String authType)
I/monodroid-gref(12715): at Android.Runtime.AndroidEnvironment.TrustEvaluateSsl2(Mono.Security.X509.X509CertificateCollection certs, System.Object sender, System.Security.Cryptography.X509Certificates\
.X509Certificate2 certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, SslPolicyErrors errors)
I/monodroid-gref(12715): at .invoke_bool__this___X509CertificateCollection_object_X509Certificate2_X509Chain_SslPolicyErrors(Mono.Security.X509.X509CertificateCollection , System.Object , Syst\
em.Security.Cryptography.X509Certificates.X509Certificate2 , System.Security.Cryptography.X509Certificates.X509Chain , Ssl

Sign In or Register to comment.