12

If i try to edit one of my layout.xml, Eclipse is getting slower and slower, and after about 1 minute it blows me 5-6 lines of "Java heap space" error message, nothing more just this:

Error1

After this, Eclipse is not responding, i force quit from it and i got this second error:

Error2

It is happens, everytime i want to edit that particular layout.

Can somebody tell me any advice what should i do about this? I cant continue my work, it is really annoying, its just blocks me and i cannot do anything, i got this error about 10 times.

E D I T:

A lot of people said to increase heap size, configure Eclipse to your computer in .ini file etc, etc.. Just in case now i highlight the problem: this is not a configuration error, this is clearly an Eclipse bug, that is consumes all the memory you have in like minutes, no matter how much you have. Configuring the .ini file wont solve THIS issue.

Try to turn off Lint instead.

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
  • Change the entries in your Eclipse.ini to: -vmargs -XX:MaxPermSize=256m -Xms40m -Xmx800m – Thommy Feb 06 '13 at 14:34
  • i edited. Now eclipse dont start, instead of it shows the second error with some changed parameters but the same. – Adam Varhegyi Feb 06 '13 at 14:37
  • Then reduce the -Xmx value a few steps and check when its working. – Thommy Feb 06 '13 at 14:39
  • You can increase or change the size of Java heap space by using JVM command line option -Xms, -Xmx, try -Xmx256m – Christophe Roussy Feb 06 '13 at 14:40
  • I dont think it is matter of settings, it looks like Eclipse launches an infinite cycle or something else like that. It is not normal that i simply add a TextView and BUMM, out of memory... Eclipse is a piece of.... – Adam Varhegyi Feb 06 '13 at 14:50

3 Answers3

16

I turned off Lint and problem solved. If you have this kind of problem always turn off Lint.

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
  • 3
    Window -> Preferences -> Android -> Lint Error Checking -> then untick checkboxes at top of page. – Adam Varhegyi Apr 23 '13 at 13:22
  • i couldn't able to find this options under preferences -> android.. There only i can find the android versions alone. – Sampath Kumar Apr 24 '13 at 10:30
  • You must click on the little triangle on the left of "Android" label, that will show some drop down menu items and there will be Lint Error Checking! – Adam Varhegyi Apr 25 '13 at 09:26
  • Increase you heap size from Eclipse.ini file in the same folder where Eclipse.exe is located :) – Noman Apr 26 '13 at 12:59
  • how much heap size to increase ..-I have some thing like this -launcher.XXMaxPermSize 256M -showsplash should i have to increase heap size and disable lint check both ? – Bora Jun 17 '13 at 06:31
  • i am running a large android project,in there are several(700 files) files.so i want to increase the heap size of android project.how to do that?? i already increase the haep size in eclipse.ini file,but it is not helping – abh22ishek Jan 09 '14 at 06:40
  • really good! It really disturb me. This solution help me so much. Thank so much! – Phuong Jun 23 '15 at 01:04
  • Turning off Lint may make the error go away but you still in all likelihood have some sort of recursion in your layout. Either that or you've found a bug in Lint. You might want to check your layout anyway. – Kelly S. French Aug 20 '15 at 14:26
  • Saved My Time :) Thank you. – Pratik Butani Nov 17 '15 at 14:21
3

Something in the layout is trying to manipulate a large amount of data and the processing of it forces the JVM to run out of heap. Is there any transformation or XSLT being used? Does the schema allow for infinite nesting of child nodes of a tag?

Check the layout for either some form of recursion, or any other type of infinite expansion.

Try posting a separate question with the title, "What would cause this XML to use up memory?" and include the XML code for the layout. You could do that here but it would be cleaner to add a new question.

Kelly S. French
  • 12,198
  • 10
  • 63
  • 93
0

i had this same issue some minute ago, but what i did was i change the image i was about to use cos the property was too large. so try and you another image and you will be able to see you work without touching any any setting