Giter Site home page Giter Site logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 9 Feb 2011 at 1:06

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
What is the output of

int allocation = indices.length * 3 * 8;
Log.e("Allocating Float Array", "bytes: " + allocation);

Original comment by [email protected] on 26 Feb 2011 at 9:55

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 26 Feb 2011 at 10:28

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 26 Feb 2011 at 10:31

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 1 Mar 2011 at 6:43

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 1 Mar 2011 at 7:48

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
[deleted comment]

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 1 Mar 2011 at 11:19

from min3d.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
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 [email protected] on 3 Mar 2011 at 11:34

from min3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.