{"action":"opened","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/2598","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/2598/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/2598/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/2598/events","html_url":"https://github.com/square/okhttp/issues/2598","id":158113252,"number":2598,"title":" Exception java.lang.OutOfMemoryError: Could not allocate JNI Env","user":{"login":"Vivecstel","id":3096681,"avatar_url":"https://avatars.githubusercontent.com/u/3096681?v=3","gravatar_id":"","url":"https://api.github.com/users/Vivecstel","html_url":"https://github.com/Vivecstel","followers_url":"https://api.github.com/users/Vivecstel/followers","following_url":"https://api.github.com/users/Vivecstel/following{/other_user}","gists_url":"https://api.github.com/users/Vivecstel/gists{/gist_id}","starred_url":"https://api.github.com/users/Vivecstel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vivecstel/subscriptions","organizations_url":"https://api.github.com/users/Vivecstel/orgs","repos_url":"https://api.github.com/users/Vivecstel/repos","events_url":"https://api.github.com/users/Vivecstel/events{/privacy}","received_events_url":"https://api.github.com/users/Vivecstel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-02T10:55:02Z","updated_at":"2016-06-02T10:55:02Z","closed_at":null,"body":"Got this exception from a beta tester using samsung galaxy s3 tracked by google's firebase : \r\n\r\n\r\nException java.lang.OutOfMemoryError: Could not allocate JNI Env\r\njava.lang.Thread.nativeCreate (Thread.java:)\r\njava.lang.Thread.start (Thread.java:1063)\r\nokhttp3.internal.framed.FramedConnection.start (FramedConnection.java:525)\r\nokhttp3.internal.framed.FramedConnection.start (FramedConnection.java:509)\r\nokhttp3.internal.io.RealConnection.establishProtocol (RealConnection.java:210)\r\nokhttp3.internal.io.RealConnection.buildConnection (RealConnection.java:171)\r\nokhttp3.internal.io.RealConnection.connect (RealConnection.java:111)\r\nokhttp3.internal.http.StreamAllocation.findConnection (StreamAllocation.java:187)\r\nokhttp3.internal.http.StreamAllocation.findHealthyConnection (StreamAllocation.java:123)\r\nokhttp3.internal.http.StreamAllocation.newStream (StreamAllocation.java:93)\r\nokhttp3.internal.http.HttpEngine.connect (HttpEngine.java:296)\r\nokhttp3.internal.http.HttpEngine.sendRequest (HttpEngine.java:248)\r\nokhttp3.RealCall.getResponse (RealCall.java:243)\r\nokhttp3.RealCall$ApplicationInterceptorChain.proceed (RealCall.java:201)\r\nokhttp3.RealCall.getResponseWithInterceptorChain (RealCall.java:163)\r\nokhttp3.RealCall.execute (RealCall.java:57)\r\ncom.steleot.seriez.utils.HttpClient.executeGetRequest (HttpClient.java:74)\r\ncom.steleot.seriez.utils.JobsUtils.getEpisodes (JobsUtils.java:594)\r\ncom.steleot.seriez.services.AddBaseIntentService.runEpisodes (AddBaseIntentService.java:95)\r\ncom.steleot.seriez.services.AddBaseIntentService.runService (AddBaseIntentService.java:41)\r\ncom.steleot.seriez.services.AddSeriesIntentService.onRun (AddSeriesIntentService.java:49)\r\ncom.steleot.seriez.services.base.BaseIntentService.onHandleIntent (BaseIntentService.java:47)\r\nandroid.app.IntentService$ServiceHandler.handleMessage (IntentService.java:66)\r\nandroid.os.Handler.dispatchMessage (Handler.java:102)\r\nandroid.os.Looper.loop (Looper.java:158)\r\nandroid.os.HandlerThread.run (HandlerThread.java:61)\r\n\r\n\r\nbelow is method call from HttpClient : \r\n\r\npublic String executeGetRequest(String url, String token) {\r\n        Response response;\r\n        OkHttpClient okHttpClient = new OkHttpClient.Builder()\r\n                .connectTimeout(15, TimeUnit.SECONDS)\r\n                .readTimeout(15, TimeUnit.SECONDS)\r\n                .writeTimeout(15, TimeUnit.SECONDS)\r\n                .build();\r\n\r\n        Request request = new Request.Builder()\r\n                .url(url)\r\n                .addHeader(AUTHORIZATION, BEARER + \" \" + token)\r\n                .addHeader(ACCEPT_LANGUAGE, PreferenceUtils.getString(mContext, mContext.getString(R.string.languageKey),\r\n                        mContext.getString(R.string.englishValue)).toLowerCase())\r\n                .build();\r\n\r\n        try {\r\n            response = okHttpClient.newCall(request).execute();\r\n            return response.body().string();\r\n        } catch (IOException e) {\r\n            LogHelper.d(e.getMessage());\r\n        }\r\n        return null;\r\n    }\r\n\r\n\r\nThanks"}}
{"actor":{"display_login":"Vivecstel"}}