Uses an EvictingQueue instead of an ArrayList in the PacketLoggingServiceImpl.

smack4
George Politis 10 years ago
parent 378d3fc05f
commit e0a28662b0

@ -20,6 +20,7 @@
import java.io.*;
import java.util.*;
import com.google.common.collect.*;
import net.java.sip.communicator.util.*;
import org.jitsi.service.fileaccess.*;
@ -769,7 +770,7 @@ private class SaverThread
/**
* List of packets queued to be written in the file.
*/
private final List<Packet> pktsToSave = new ArrayList<Packet>();
private final Queue<Packet> pktsToSave = EvictingQueue.create(10);
/**
* Initializes a new <tt>SaverThread</tt>.
@ -805,7 +806,7 @@ public void run()
continue;
}
pktToSave = pktsToSave.remove(0);
pktToSave = pktsToSave.poll();
}
if(pktToSave != null)

Loading…
Cancel
Save