GC_CONCURRENT Freed

+1 vote
Hi, 
I am using SocialService method: GetFacebookFriendsFromLinkUser.
 
This error happens when there are many friends:
 
03-24 20:29:36.875: D/dalvikvm(3717): GC_CONCURRENT freed 758K, 53% free 3595K/7495K, external 1180K/1682K, paused 4ms+7ms
 
How to fix this problem?
 
Thanks.
asked Mar 25, 2014 in App42 Cloud API-BaaS by renanalmeida (15 points)

2 Answers

+1 vote

hi  renanalmeida,

Your heap is full .Please increase heap size.

answered Mar 25, 2014 by naresh (350 points)
Thank you, naresh.

How do I do this? I think the memory overflow is due to SocialService.

I use Android Api, My code is as in the examples:

public void getFbFriends(final String userID,
            final FriendList callback){
       
        final String userName = userID;  
        final Handler callerThreadHandler = new Handler();
        new Thread() {
            @Override
            public void run() {
                    socialService.getFacebookFriendsFromLinkUser(userName, new App42CallBack() {  
                    public void onSuccess(Object response)   
                    {  
                        Social social  = (Social)response;  
                        final ArrayList<Friends> friendlist = new ArrayList<Social.Friends>();
           
                        for(int i =0; i < social.getFriendList().size();i++)  
                        {  
                            if(social.getFriendList().get(i).getInstalled()){
                                friendlist.add(social.getFriendList().get(i));
                            }
                           
                        }  
                        callerThreadHandler.post(new Runnable() {
                            @Override
                            public void run() {
                                callback.onFriendListFetched(friendlist);
                            }
                        });
                    }  
                    public void onException(final Exception ex)   
                    {  
                        callerThreadHandler.post(new Runnable() {
                            @Override
                            public void run() {
                                callback.onFbError(ex.toString());
                            }
                        });
                    }  
                    });      
       
                }
            }.start();
    }
0 votes

hi Renanalmeida, Thanx for revert. Can you please also share your Adapter java class in which you are making your List.

  1. May be there is some memory leaks are there so that there is problem of memory frementation.
  2.  I would suggest you to create a static pool of Bitmaps that would be reused by new images , when ever required in your code.
  3. Or you can also specify in AndroidManifest.xml android:largeHeap="true" property.
  4.  So this is because creating a bitmap of images again and again without reusing them.

 

Thanx.

answered Mar 26, 2014 by Vishnu Garg (674 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...