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

  • Home
  • SEARCH
  • 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 6869447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:33:32+00:00 2026-05-27T03:33:32+00:00

I have a big Memory Problem: // in sourceImage is a big JPEG previously

  • 0

I have a big Memory Problem:

// in sourceImage is a big JPEG previously loaded
Matrix mat = new Matrix();
mat.postRotate(90);
Bitmap rotatedImage = Bitmap.createBitmap(sourceImage, 0, 0, sourceImage.getWidth(), sourceImage.getHeight(), mat, true);

Always i Run this code, my App crashes and says “VM won’t let us allocate xxxxxx bytes”

Can you help me?

Edit:

I saw much similar questions here, but i don’t know how to recycle the sourceImage before rotatating it… (cause the second instance is to big to hold it at the same time)

Thanks.

  • 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-05-27T03:33:32+00:00Added an answer on May 27, 2026 at 3:33 am

    You can’t create a new rotated bitmap without holding temporary 2 bitmaps in memory.

    But you can display the bitmap rotated without creating a new bitmap (apply a transformation).

    ImageView does not come with rotation capabilities, so you should write your own extended version of ImageView (RotatedImageView?).

    The idea is to override the onDraw method with something like this (not tested).

    @Override
    public void onDraw(Canvas canvas) {     
        canvas.rotate((int)(angle * 180 / Math.PI), getWidth() >> 1, getHeight() >> 1);
        super.onDraw(canvas);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a C# problem. I have a big object in memory at a
I have a big problem with Google Chrome and its memory. My app is
I have a big problem with my application and the memory. The application (java
I have a big problem with std::wstring memory allocation. The program crash when I
I have a piece of code that load a very big image in memory.
I have big problem when I am trying to deploy my app over clickonce.
I have a big problem in website http://www.konasignature.com/ . While load my website in
I know that my network printer (big Konica Minolta) have own memory and storage
I have a big problem, that I am reading 2^21 bytes from a video
I have a big file that can't fit in the memory which I would

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.