Open GoogleCodeExporter opened 9 years ago
And I have to notice that it is not a polycount problem 'cause the effect is
same for a near 1000 poly model and for simple Box.
Original comment by wiern...@gmail.com
on 9 Feb 2011 at 1:06
What is the output of
int allocation = indices.length * 3 * 8;
Log.e("Allocating Float Array", "bytes: " + allocation);
Original comment by ArturoTh...@gmail.com
on 26 Feb 2011 at 9:55
if you mean number of vertices by indeces it returns:
02-26 23:24:45.271: ERROR/Allocating Float Array(621): bytes: 13824
Original comment by wiern...@gmail.com
on 26 Feb 2011 at 10:28
I found that indices is calculated as header.numTriangles*3, so I checked the
value you wanted by calculating:
int allocation = header.numTriangles*3 * 3 * 8;
Original comment by wiern...@gmail.com
on 26 Feb 2011 at 10:31
I'm sorry about my previous post - i should have asked:
What is the output of:
# KeyFrame.java
public void setIndices(int[] indices) {
this.indices = indices;
int allocation = indices.length * 3 * 4; // 4 bytes per float not 8 my mistake
Log.e("Allocating Float Array", "bytes: " + allocation);
float[] compressed = vertices;
vertices = new float[indices.length*3];
// rest of method
I only brought this up as I had a somewhat similar issue in AParser.generate()
where a new int array was declared as such:
# AParser.java -> generate()
int[] pixels = new int[w * h];
Somehow a texture slipped into my project that was 1024x1024 - which attempted
to allocate 4mb of space and crashed the android runtime.
Have you attached the Heap tracker to your application process to see how much
memory is allocated and how much is available?
Original comment by ArturoTh...@gmail.com
on 1 Mar 2011 at 6:43
Here's what happens when I load md2 model with 195 frames:
03-01 19:44:53.266: INFO/dalvikvm-heap(577): Clamp target GC heap from 16.698MB
to 16.000MB
03-01 19:44:53.297: DEBUG/dalvikvm(577): GC freed 55666 objects / 1387216 bytes
in 271ms
03-01 19:44:53.366: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:53.536: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:53.736: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:53.936: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:54.096: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:54.336: INFO/dalvikvm-heap(577): Clamp target GC heap from 17.134MB
to 16.000MB
03-01 19:44:54.356: DEBUG/dalvikvm(577): GC freed 35984 objects / 906488 bytes
in 232ms
03-01 19:44:54.516: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:54.706: ERROR/Allocating Float Array blah(577): bytes: 49896
03-01 19:44:54.936: INFO/dalvikvm-heap(577): Clamp target GC heap from 17.214MB
to 16.000MB
03-01 19:44:54.946: DEBUG/dalvikvm(577): GC freed 16540 objects / 414656 bytes
in 234ms
03-01 19:44:54.946: INFO/dalvikvm-heap(577): Forcing collection of
SoftReferences for 49912-byte allocation
03-01 19:44:55.136: INFO/dalvikvm-heap(577): Clamp target GC heap from 17.214MB
to 16.000MB
03-01 19:44:55.146: DEBUG/dalvikvm(577): GC freed 0 objects / 0 bytes in 179ms
03-01 19:44:55.176: ERROR/dalvikvm-heap(577): Out of memory on a 49912-byte
allocation.
I see your point, but in this case it should be connected with number of
vertices etc... But that crash happens even when using default example md2 ogro
from min3D SDK. As I said... it happens even on phone, so it's not the emulator
fault... How can I attach that Heap tracker? DDMS shows the memory usage like
above... Please help...
Original comment by wiern...@gmail.com
on 1 Mar 2011 at 7:48
[deleted comment]
I did some tests which shown that it is exactly the moment of loading md2
model, when it rises memory usage from around 3 mb to over 16 mb... Even with
the example one...
Original comment by wiern...@gmail.com
on 1 Mar 2011 at 11:19
The problem has been solved... It was question of too large polycount... over
1000 polygons is too much for md2 and android platform memory limits... Thanks
for help :)
Original comment by wiern...@gmail.com
on 3 Mar 2011 at 11:34
Original issue reported on code.google.com by
wiern...@gmail.com
on 9 Feb 2011 at 10:50