Application freezing android every 2sec
<p>I have an application which capture frame(UDP) every 50ms and update my view with this data.
But my application is freezing during 100/200ms every 2sec. In the LogCat a message appear : GC_CONCURRENT.</p>

<p>I don't know if a link exist between this message and my freezing. If yes, is there a solution to avoid this?`</p>

<pre><code>            try {
                view.setClientSocket(new MulticastSocket(54321));
                ip = InetAddress.getByName("224.2.2.4");
                view.getClientSocket().joinGroup(ip);

            } catch (SocketException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            int cpt = 0;
            while(true){
                cpt++;
            try {
                if (view.isPort_change() == true){
                    view.setClientSocket(new MulticastSocket(54321));
                    ip = InetAddress.getByName("224.2.2.4");
                    view.getClientSocket().joinGroup(ip);
                    view.setPort_change(false);
            }

            int result = -1;            
            if(view.isCapture() == true &amp;&amp; listeinit==true)
            {
                DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length,ip,54321);    
                view.getClientSocket().receive(receivePacket); 
                String modifiedSentence = new String(receivePacket.getData(),0,receivePacket.getLength());

                for(int i=0; i&lt;modifiedSentence.split("\\+").length; i++)
                {
                    String[] donnee = modifiedSentence.split("\\+")[i].split(":");
                    for(Hashtable.Entry&lt;Integer, String&gt; entry : view.getAll_parameters().entrySet()){
                        if(entry.getValue().equals(donnee[0])){
                            result = entry.getKey();
                            break;
                        }
                    }
                    if (result== -1)
                    {
                        view.getBloc().add(donnee[1]);
                    }
                    else
                    {
                        view.getBloc().set(result,donnee[1]);                           
                    }
                }
             //     if(cpt%5==0)
                    {

                        view.getHandler().sendEmptyMessage(1);
                    }
            }
        }`
</code></pre>
