Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Using EditText for Text Input

Out of memory errors

Hello Ben or anyone else, can you help solve the Out of memory error i keep getting when i run my app. thank you.

Caused by: java.lang.OutOfMemoryError

4 Answers

Hi Daniel,

Which part of the app are you getting this error in.

It must be a runtime error - what is Logcat saying?

We can help with your problem with just a bit more information.


I made my background from photoshop, when i run it android displays out of memory error. yes it is a run time error

If you remove your background and just use an in-app one, do you run out of memory or is it the size of the background file that you are using causing the problem. If this is in the emulator, you can increase the amount of virtual memory it has available.


what should be the exact background size i should use then to keep things smoothe

I've no idea; sorry. That would depend on each device, I guess.

Have you tried running the app without your background - does that run OK?

What file size is your background image?