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 trialdanielplaisimnd
6,837 PointsOut 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
Steve Hunter
57,712 PointsHi 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.
Steve.
Steve Hunter
57,712 PointsIf 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.
Steve.
danielplaisimnd
6,837 Pointswhat should be the exact background size i should use then to keep things smoothe
Steve Hunter
57,712 PointsI'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?
danielplaisimnd
6,837 Pointsdanielplaisimnd
6,837 PointsI made my background from photoshop, when i run it android displays out of memory error. yes it is a run time error