title: Could not allocate JNI Env
body: <p>I'm updating my API every 2seconds,<br>
  but I am receiving this error and my application closes.  </p>
  
  <blockquote>
    <p>FATAL EXCEPTION: main
                                                                               Process: com.application.toweeloasep, PID: 6681
                                                                               java.lang.OutOfMemoryError: Could not allocate JNI Env
                                                                                   at java.lang.Thread.nativeCreate(Native Method)
                                                                                   at java.lang.Thread.start(Thread.java:730)
                                                                                   at com.android.volley.RequestQueue.start(RequestQueue.java:145)
                                                                                   at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:66)
                                                                                   at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:78)
                                                                                   at com.application.toweeloasep.fragments.Jobs$5$1.run(Jobs.java:260)
                                                                                   at android.os.Handler.handleCallback(Handler.java:751)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                   at android.os.Looper.loop(Looper.java:154)
                                                                                   at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                                   at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)</p>
  </blockquote>
  
  <p>After about a minute, it starts to crash and receives that error.<br>
  Am I overdoing things with Volley?</p>
  
  <pre><code>private void setRepeatingAsyncTask() {
          final Handler handler = new Handler();
          Timer timer = new Timer();
          TimerTask task = new TimerTask() {
              @Override
              public void run() {
                  handler.post(new Runnable() {
                      public void run() {
                          try {
                              if (checkRequests) {
                                  RequestQueue mRequestQueue = Volley.newRequestQueue(getActivity());
                                  StringRequest mStringRequest = new StringRequest(Request.Method.POST, "http://api.000.com/booking/track", new Response.Listener&lt;String&gt;() {
                                      @Override
                                      public void onResponse(String response) {
                                          Log.e("RESPONSE:TRACK", response);
                                          try {
                                              JSONObject json = new JSONObject(response);
                                              String mStatus = json.getString("status");
                                              if (mStatus.equalsIgnoreCase("0")) {
                                                  Log.e("STATUS", mStatus);
                                              } else if (mStatus.equalsIgnoreCase("1")) {
                                                  JSONArray infos = json.getJSONArray("data");
                                                  booking_id = infos.getJSONObject(0).getString("id");
                                                  user_address_location = infos.getJSONObject(0).getString("user_address_location");
                                                  mTxtBatteryInfo.setText(infos.getJSONObject(0).getJSONObject("battery").getString("model"));
                                                  mTxtUserLocation.setText(user_address_location);
                                                  checkRequests = false;
                                                  mJobsHome.setVisibility(View.GONE);
                                                  mJobRequest.setVisibility(View.VISIBLE);
                                                  if (!onTick) {
                                                      mCountDownTimer.start();
                                                      onTick = true;
                                                  }
                                              }
                                          } catch (Exception e) {
                                              Log.e("ERR", e.toString());
                                          }
                                      }
                                  }, new Response.ErrorListener() {
                                      @Override
                                      public void onErrorResponse(VolleyError error) {
                                          Log.e("ERR", error.toString());
                                      }
                                  });
                                  mRequestQueue.add(mStringRequest);
                              } else {
                                  RequestQueue requestPlaceInfo = Volley.newRequestQueue(getActivity());
                                  StringRequest request2 = new StringRequest(Request.Method.POST, "http://api.000.com/booking/track", new Response.Listener&lt;String&gt;() {
                                      @Override
                                      public void onResponse(String response) {
                                          Log.e("RESPONSE", response);
                                      }
                                  }, new Response.ErrorListener() {
                                      @Override
                                      public void onErrorResponse(VolleyError error) {
                                          Toast.makeText(getActivity(), error.toString(), Toast.LENGTH_SHORT).show();
                                      }
                                  }) {
                                      @Override
                                      protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                                          Map&lt;String, String&gt; params = new HashMap&lt;&gt;();
                                          params.put("booking_id", booking_id);
                                          params.put("rider_long", String.valueOf(lng));
                                          params.put("rider_lat", String.valueOf(lat));
                                          return params;
                                      }
                                  };
                                  requestPlaceInfo.add(request2);
                              }
                          } catch (Exception e) {
                              // error, do something
                          }
                      }
                  });
              }
          };
          timer.schedule(task, 0, 2000);  // interval of one minute
      }
  </code></pre>