Android内存不足当在POST中发送图像时

时间:2011-07-12 11:21:10

标签: android forms post entity out-of-memory

应用程序似乎在线内存不足:
postFormEntity = new UrlEncodedFormEntity(nameValuePairs);

*从SD卡中检索文件时,将最少的内存放在堆上的最佳方法是什么?

             picCRC = new BasicNameValuePair("crc", crc );
             pic = new BasicNameValuePair("pic", postFile);

             postFile = "";

             nameValuePairs = new ArrayList<NameValuePair>(2);
             nameValuePairs.add(picCRC);
             picCRC = null;
             nameValuePairs.add(pic);
             pic = null;
             System.gc();
             postFormEntity = new UrlEncodedFormEntity(nameValuePairs);

             request2.setEntity(postFormEntity);

             result = httpclient.execute(request2, handler);

0 个答案:

没有答案