Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:24:48+00:00 2026-06-16T03:24:48+00:00

Hi Lets say when i call Activity A to Activity B below is my

  • 0

Hi Lets say when i call Activity A to Activity B

below is my code become

     Intent i = new Intent(TemplateList.this, PictureEditor.class);
     Bundle b = new Bundle();
     b.putString("Key", "2");
     b.putString("Index", imagepathString);
     i.putExtras(b);
     v.getContext().startActivity(i);
     System.gc();
     Runtime.getRuntime().gc();
     finish();

Because of in Activity A there are so many objects (so many images) loaded so i am clearing that all objects by System.gc();
Runtime.getRuntime().gc();
will be cleared and also destroying activity so no any object will be stay allocated 🙂

and from Activity B i am going call to Activity A

        btnTemplate.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            startActivity(new Intent(PictureEditor.this, TemplateList.class));
            dg.dismiss();
            if (bmp != null) {
                bmp.recycle();
                bmp = null;
            }
            System.gc();
            Runtime.getRuntime().gc();
            finish();
        }
    });

//Here also i m calling System.gc and Runtime.getRuntime.gc and destroying activity but do not know why if activity A starts than i m getting

below error

     12-19 12:44:48.769: E/AndroidRuntime(7539): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:405)
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:418)
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at com.redwood.PictureEditor.get_bitmap(PictureEditor.java:257)
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at com.redwood.PictureEditor$5.run(PictureEditor.java:218)
     12-19 12:44:48.769: E/AndroidRuntime(7539):    at java.lang.Thread.run(Thread.java:1019)

Can any body solve my problem 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:24:50+00:00Added an answer on June 16, 2026 at 3:24 am

    Calling those methods won’t work, those methods just say to the GC that “if you want you can run now”.

    Basically look for those problems:

    • Isn’t the bitmap too big? -> Rescale it to the minium required size in your app.
    • Are you copying the bitmap too much?
    • Aren’t you leaking the bitmap by leaking the context of your Activity B?

    It could come from many places but I would try to downscale it to the minimum required size in your app first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have the following Request URI: /controller/action/filter// When I call $this->_getParam('filter') in
Lets say I have a class like this in Java: public class Function {
Lets say im im in some activity, and call to some background operation SomeOperation
So, lets say in my main activity, i have an array declared like this,
Lets say I've run the following code: var toType = function(obj){ return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); };
Lets say i've a Album class. How do i code the compareTo method so
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Lets say I call: make -j 5 Is there a way, within my Makefile
For example, I often use this: [self performSelector:@selector(doSomethingAfterDelay:) withObject:someObject afterDelay:someDelay]; Now, lets say I
Lets say I have a stored proc call MyStoredProc which recieved an int (@MyParam

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.