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.
Hope that helps... tom Here's the test program: import java.*; import visad.*; import java.lang.*; public class olver { public static void main(String[] a) { try { RealType rt1 = new RealType("xc"); RealType rt2 = new RealType("yc"); RealType rt3 = new RealType("rc"); RealTupleType dt = new RealTupleType(rt1,rt2); FunctionType ft = new FunctionType(dt, rt3); Integer2DSet ds = new Integer2DSet(1000,1000); Integer1DSet[] rs = { new Integer1DSet(rt3, 255)}; //FlatField ff = new FlatField(ft, ds, null, null, rs, null); FlatField ff = new FlatField(ft, ds, null, null, null, null); float[][] data = new float[1][1000 * 1000]; int z=0; for (int i=0; i<1000; i++) { for (int j=0; j<1000; j++) { data[0][z] = i+j; z++; } } ff.setSamples(data); data = null; System.gc(); double totalMemory = (double) Runtime.getRuntime ().totalMemory (); double freeMemory = (double) Runtime.getRuntime ().freeMemory (); double usedMemory = (totalMemory-freeMemory); int percent = (int)(100.0*(usedMemory/totalMemory)); totalMemory = totalMemory/1000000.0; usedMemory = usedMemory/1000000.0;System.out.println("#### total, used, percent="+totalMemory+" +usedMemory+" "+percent);
} catch (Exception e) {e.printStackTrace(); } } } OLVER OLFREY HERNANDEZ NAVARRO wrote:
Hi all. I'm working with Satellite Images, and I'm using visad to visualizate them. I need that visad use less memory, then I try to construct the FlatField in this way: new FlatField( func_domain_range, domain_set,null,null,new Integer1DSet[] {new Integer1DSet(varRaster,255)},null); but it spend more memory that in this way: new FlatField( func_domain_range, domain_set,null,null,null,null); Why the first one use more memory? Thank's -- Olver Hernández Facultad de Minas Universidad Nacional de Colombia Sede Medellín
-- Tom Whittaker (tomw@xxxxxxxxxxxxx) University of Wisconsin-Madison Space Science and Engineering Center Cooperative Institute for Meteorological Satellite Studies Phone/VoiceMail: 608.262.2759
visad
archives: