0
我使用藍牙客戶端 - 服務器通信將數據從Android手機發送到Google Glass.多次運行代碼後,我有GC_FOR_ALLOC被釋放...垃圾回收問題 和Google玻璃的內存是幾乎全滿, 這是while循環,我認爲這個問題谷歌眼鏡記憶
private void manageConnectedSocket(BluetoothSocket socket) {
while(socket.isConnected()) {
try {
BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
mResult = input.readLine();
prev=mResult;
if(!prev.equals(next)){
System.out.println("result=" + mResult);
/** PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
//out.println(Integer.parseInt(mResult)+50);
out.println(mResult);**/
runOnUiThread(new Runnable() {
public void run() {
mTvInfo.setText(mResult);
next=prev; }
});
}
// socket.close();
// manageConnectedSocket(socket);
} catch (IOException e) {
final IOException ex = e;
runOnUiThread(new Runnable() {
public void run() {
mTvInfo.setText(ex.getMessage());
}
});
}
}
請,我需要一種方法來清潔谷歌眼鏡的內存的原因