NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Memory...

Hi all,

        I'll try to explain my problem :
        I've got a mesh in 3D with about 200 000 samples and 1 000 000 tetras.
I apply the method used in Delaunay.main (line 955...) :

                DelaunayCadoe delaun = new DelaunayCadoe(samples,tetra);
                // The same as DelaunayCustom but without copy, with debug and
                // 4 edges (6 in DelaunayCustom)

                Irregular3DSet iset = new
Irregular3DSet(xyz,samples,null,null,null,delaun);

                int numEdges = delaun.NumEdges;
                Gridded3DSet[] gsp = new Gridded3DSet[numEdges];
                int[] e0 = {0, 0, 1, 2};
                int[] e1 = {1, 3, 2, 3};
                for (int i=0; i<numEdges; i++) gsp[i] = null;

                for (int i=0; i<delaun.Edges.length; i++) {
                    int[] trii = delaun.Tri[i];
                    int[] edgesi = delaun.Edges[i];
                    for (int j=0; j<4; j++) {
                        if (gsp[edgesi[j]] == null) {
                            float[][] pts = new float[3][2];
                            float[] p0 = pts[0];
                            float[] p1 = pts[1];
                            float[] p2 = pts[2];
                            int tp0 = trii[e0[j]];
                            int tp1 = trii[e1[j]];
                            p0[0] = samples[0][tp0];
                            p1[0] = samples[1][tp0];
                            p2[0] = samples[2][tp0];
                            p0[1] = samples[0][tp1];
                            p1[1] = samples[1][tp1];
                            p2[1] = samples[2][tp1];
                            gsp[edgesi[j]] = new Gridded3DSet(xyz, pts, 2);
                        }
                    }
                }
                UnionSet tet = new UnionSet(xyz, gsp);
                final DataReference tetref = new DataReferenceImpl("tet");
                tetref.setData(tet);
                
The problem is that this part of code and the display of this mesh, use
about 755M of Memory...
As i'm quite new in java, I don't know which element is so huge (There
is no sizeof() as in C ?).

how can I optimize this code ?
Any comments may be very helpful...

-Sylvain-


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: