Memory and Performance, and Arrays of Objects.

I have a Class called ChannelObject. The Class has 15 to 20 primitive types. Each object of this class represents data read in from a file or received over a network. I don't know how many of these objects will be created, it could be anywhere between 0 and 5 million.
Which would be a better way to store these objects?
1. In an ArrayList(since it's dynamic and I can add to it when I have data, but I've read that an ArrayList isn't good when you're adding the same type of object) or
2. A very large array(that could be mostly empty and wasted space)
3. Or another option?
I am concerned about the speed and memory of this program since it has the possibility of processing a great deal of data.
Thank You in Advance!

My ChannelObject Class has several primitive types.
long time;
float elevation;
float meas1;
float meas2;
float meas3;
float meas4;
boolean statusFlag;
... There about 10 more variables.
int crc;
The Constructor for my Class takes a DataInputStream, checks the crc to verify the data, and then breaks the DataInputStream into the primitive types.
Once I have read in the hole file or collected a day or more of data from the network, I want to scroll through the data and modify some of the data using a kalman filter and another smoothing filter. I receive a new data point once a second. This package is a building block for several other programs that will use it. Some of those programs will want to sue a days worth of data and some will want 3 months.
The data will be in order of time(I hope), and there is the possibily that I will have no data from either a network outage or the site that sends us the data can crash.
When scrolling through the data I will start at the first time(I'm assuming that's the first Object in my list), and using the initial states of my kalman filter, I will modify meas1 and meas2. Now that I have data I will update the constraints of the filter using this time and I will move onto the next time and repeat the process. Once I finish this run, I will have to do another run that will use my smoothing filter and modify meas3 and meas4. Both filters are dependent on time/order of the data.
I hope I explained this well enough.
Thanks
PS: If anyone knows of a Kalman Filter class that's already been written, I'd appreciate not having to migrate my c version. Thanks Again!

Similar Messages

  • Reading a CSV file and producing an array of objects

    Hi everybody,
    I am writing an application which will read a cvs file and produce an array of objects.
    Can any body help me to solve this problem?
    Thanks
    Finny

    Hello,
    Have you tried this link?
    http://ostermiller.org/utils/CSV.html

  • Trouble creating and populating an array of objects.

    I'm trying to create/populate an array of objects with consisting of a {string, double, integer}, and am having trouble getting this theory to work in Java. Any assistance provided would be greatly appreciated. Following are the two small progs:
    public class HairSalon
    { private String svcDesc; private double price; private int minutes;
    //Create a constructor to initialize data members
    HairSalon( )
    svcDesc = " "; price = 0.00; minutes = 0;
    //Create a constructor to receive data
         HairSalon(String s, double p, int m)
         svcDesc = s; price = p; minutes = m;
    //Create methods to get the data members
    public String getSvcDesc( )
         return svcDesc;
    public double getPrice( )
         return price;
    public int getMinutes( )
         return minutes;
    public class SortSalon
         public static void main(String[ ] args)
         SortSalon [] sal = new SortSalon[6];
    //Construct 6 SortSalon objects
              for (int i = 0; i < sal.length; i++)
              sal[i] = new SortSalon();
    //Add data to the 6 SortSalon objects
         sal[0] = new SortSalon("Cut"; 10.00, 10);
         sal[1] = new SortSalon("Shampoo", 5.00, 5);           sal[2] = new SortSalon("Sytle", 20.00, 20);
         sal[3] = new SortSalon("Manicure", 15.00, 15);
         sal[4] = new SortSalon("Works", 30.00, 30);
         sal[5] = new SortSalon("Blow Dry", 3.00, 3);
    //Display data for the 6 SortSalon Objects
         for (int i = 0; i < 6 ; i++ )
         { System.out.println(sal[i].getSvcDesc( ) + " " + sal.getPrice( ) + " " + sal[i].getMinutes( ));
         System.out.println("End of Report");

    Hey JavaMan5,
    That did do the trick! Thanks for the assistance. I was able to compile and run the program after adding my sorting routine. Do you happen to see anything I can do to clean it up further, or does it look ok? Thanks again,
    Ironjay69
    public class SortSalon
         public static void main(String[ ] args) throws Exception
         HairSalon [] sal = new HairSalon[6];      
         char selection;
    //Add data to the 6 HairSalon objects
         sal[0] = new HairSalon("Cut", 10.00, 10);
         sal[1] = new HairSalon("Shampoo", 5.00, 11);      
         sal[2] = new HairSalon("Sytle", 20.00, 20);
         sal[3] = new HairSalon("Manicure", 15.00, 25);
         sal[4] = new HairSalon("Works", 30.00, 30);
         sal[5] = new HairSalon("Blow Dry", 3.00, 3);
    System.out.println("How would you like to sort the list?");
         System.out.println("A by Price,");
         System.out.println("B by Time,");
         System.out.println("C by Description.");
         System.out.println("Please enter a code A, B or C, and then hit <enter>");
              selection = (char)System.in.read();
    //Bubble Sort the Array by user selection
              switch(selection)
              case 'A':
              BubbleSortPrice(sal, sal.length);
                   break;
                   case 'a':
              BubbleSortPrice(sal, sal.length);
                   break;
                   case 'B':
              BubbleSortTime(sal, sal.length);                    break;
                   case 'b':
              BubbleSortTime(sal, sal.length);
                   break;
                   case 'C':
              BubbleSortService(sal, sal.length);
                   break;
                   case 'c':
              BubbleSortService(sal, sal.length);
                   break;
                   default:
              System.out.println("Invalid Selection, Randomly Sorted List!");
    //Display data for the 6 HairSalon Objects
              for (int i = 0; i < sal.length ; i++ )
         System.out.println(sal.getSvcDesc( ) + " " + sal[i].getPrice( ) + " " + sal[i].getMinutes( ));
              System.out.println("___________");
              System.out.println("End of Report");
    public static void BubbleSortPrice(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by price
    int a, b;
    HairSalon temp;
    int highSubscript = len - 1;
    for(a = 0; a < highSubscript; ++a)
         for(b= 0; b < highSubscript; ++b)
         if(array.getPrice() > array[b + 1].getPrice())
              temp = array[b];
              array[b] = array [b + 1];
              array[b + 1] = temp;
    public static void BubbleSortTime(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by time
         int a, b;
         HairSalon temp;
         int highSubscript = len - 1;
         for(a = 0; a < highSubscript; ++a)
              for(b= 0; b < highSubscript; ++b)
         if(array[b].getMinutes() > array[b + 1].getMinutes())
         temp = array[b];
         array[b] = array [b + 1];
         array[b + 1] = temp;
    public static void BubbleSortService(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by time
         int a, b;
         HairSalon temp;
         int highSubscript = len - 1;
         for(a = 0; a < highSubscript; ++a)
         for(b= 0; b < highSubscript; ++b)
         if(array[b].getSvcDesc().compareTo( array[b + 1].getSvcDesc()) > 0)
                   temp = array[b];
                   array[b] = array [b + 1];
                   array[b + 1] = temp;

  • Formatted .data file, reading in and creating an array of objects from data

    Hi there, I have written a text file with the following format;
    List of random personal data: length 100
    1 : Atg : Age 27 : Income 70000
    2 : Dho : Age 57 : Income 110000
    3 : Lid : Age 40 : Income 460000
    4 : Wgeecnce : Age 43 : Income 370000
    and so on.
    These three pieces of data, Name,Age and Income were all generated randomly to be stored in an array of objects of class Person.
    Now what I must do is , read in this very file and re-create the array of objects that they were initially written from.
    I'm totally lost on how to go about doing this, I have only been learning java for the last month so anyone that can lend me a hand, that would be superb!
    Cheers!

    Looking at you other thread, you are able to create the code needed - so what's the problem?
    Here's an (not the only) approach:
    Create an array of the necessary length to hold the 3 variables, or, if you don't know the length of the file, create a class to contain the data. Then create an ArrayList to hold an instance of the class..
    Use the Scanner class to read and parse the file contents into the appropriate variables.
    Add each variable to either the array, or to an instance of the class and add that instance to the arraylist.

  • Application size in terms of pages and performance and Version Control

    Currently I'm looking into the best way to version control our APEX applications. From other threads, it seems it's an area that leaves much to be desired. We are on the verge distributing a large APEX project commercially but I cannot find a suitable versioning method to support bug fixes and new development happening at the same time to the same set of applications. I just hope everyone out there realises versioning is a vital area of the development process and VOTES for it in the V3 poll.
    Anyway, enough of the my whinging. I did have a brain wave (quite rare !). What would the drawback be to have only 1 or 2 pages per application. This would allow a developer to always import the application at the start of work (ie from versioning software such as VSS or PVCS) and then export it at the end back into say PVCS. The application has everything self contained and correct versions etc.
    This would allow more developers to work on different areas at the same time as opposed to having many pages in the one application where developers could step on each others toes etc. I've considered importing/exporting pages but the fact you cannot lock shared objects means there is a possibility that if many developers are working on the same application someone will change something that affects pages other than their own. It would also be a nightmare to tie up different versions of of pages, shared objects, applications etc. Would there a performance problem with this method ? Incidentally, why can't TABS be shared/subscribed across applications. It means they have to be created separately in each application whereas things like Nav Bars and Templates can be shared across applications.
    Currently, my thoughts are that: bug fixing for a production release has to be in a separate stream (apex installation) from say new development work for the same set of applications BUT what this means is that the bug fixes have also to be manually applied in the new development stream - which is a considerable overhead (ie twice the work).
    Thanks for hearing me out - assuming you survived to the end !
    Any encouraging comments would be appreciated !

    Wim,
    I don't entirely understand the behavior. There should be little/no difference between the two cases. I'm assuming you have no indexes, which isn't recommended for such large containers anyway. Can you make your document set available to me so I can see if I can reproduce the behavior and look at it more closely? A single container, or dbxml_dump of a container is sufficient (both compress well).
    Contact me directly at george dot feinberg at you know where.
    George

  • COMMIT and PERFORMANCE and BAPI UPDATE

    When looping through  about 10 000 documents it goes initially quite fast but in the end it is very slow. Is it a basis problem?
    Initially it takes about 0,5 sec and in the end each document update takes about 20 sec. In total about 15 hours!
    My basis consultant says I should do a commit as seldom as possible. But I want to do it after each document (=a LUW?). I could add a counter and do a commit each 100:th document, but I do not like it.
    Pseudo logic.
    loop at itab (about 20 000 recs)
    ..CALL FUNCTION 'BAPI_CTRACDOCUMENT_CHANGE'
    ..Update of a ZTABLE
    ..COMMIT WORK.
    ..GET RUNTIME+display RUNTIME-diff
    endloop.

    Hi mikael,
    1. My basis consultant says I should do a commit as seldom as possible
    Yes, they are right.
    If we don't do commit,
    then,
    in the database, the rollback area
    goes on increasing, increasing,
    and occupies memory and gets slow.
    2. I could add a counter and do a commit each 100
    Thats the best practical solution.
    The figure 100 or 50 or 200 etc,
    one has to figure out practically.
    regards,
    amit m.

  • How to pass a array of object to oracle procedure using callable

    Hi,
    I am calling a oracle stored procedure using callable statement which has IN and OUT parameter of same type.
    IN and OUT are array of objects. (ie) IN parameter as Array of Objects and OUT parameter as Array of Objects
    here are the steps i have done as advised from oracle forum. correct me if i am in wrong direction
    ORACLE types and Stored Procedure
    CREATE OR REPLACE
    TYPE APPS.DEPARTMENT_TYPE AS OBJECT (
    DNO NUMBER (10),
    NAME VARCHAR2 (50),
    LOCATION VARCHAR2 (50)
    CREATE OR REPLACE
    TYPE APPS.DEPT_ARRAY AS TABLE OF department_type;
    CREATE OR REPLACE package body APPS.insert_object
    IS
    PROCEDURE insert_object_prc (d IN dept_array, d2 OUT dept_array)
    IS
    BEGIN
    d2 := dept_array ();
    FOR j IN 1 .. d.COUNT
    LOOP
    d2.EXTEND;
    d2 (j) := department_type (d (j).dno, d (j).name, d(j).location);
    END LOOP;
    END insert_object_prc;
    END insert_object;
    JAVA CODE
    Value Object
    package com.custom.vo;
    public class Dep {
    public int empNo;
    public String depName;
    public String location;
    public int getEmpNo() {
    return empNo;
    public void setEmpNo(int empNo) {
    this.empNo = empNo;
    public String getDepName() {
    return depName;
    public void setDepName(String depName) {
    this.depName = depName;
    public String getLocation() {
    return location;
    public void setLocation(String location) {
    this.location = location;
    to call stored procedure
    package com.custom.callable;
    import com.custom.vo.Dep;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleTypes;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.sql.Datum;
    import oracle.sql.STRUCT;
    import oracle.sql.StructDescriptor;
    public class CallableArrayTryOut {
    private static OracleDataSource odcDataSource = null;
    public static void main(String[] args) {
    OracleCallableStatement callStatement = null;
    OracleConnection connection = null;
    try {
    odcDataSource = new OracleDataSource();
    odcDataSource
    .setURL("......");
    odcDataSource.setUser("....");
    odcDataSource.setPassword("....");
    connection = (OracleConnection) odcDataSource.getConnection();
    } catch (Exception e) {
    System.out.println("DB connection Exception");
    e.printStackTrace();
    Dep[] dep = new Dep[2];
    dep[0] = new Dep();
    dep[0].setEmpNo(100);
    dep[0].setDepName("aaa");
    dep[0].setLocation("xxx");
    dep[1] = new Dep();
    dep[1].setEmpNo(200);
    dep[1].setDepName("bbb");
    dep[1].setLocation("yyy");
    try {
    StructDescriptor structDescriptor = new StructDescriptor(
    "APPS.DEPARTMENT_TYPE", connection);
    STRUCT priceStruct = new STRUCT(structDescriptor, connection, dep);
    STRUCT[] priceArray = { priceStruct };
    ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
    "APPS.DEPT_ARRAY", connection);
    ARRAY array = new ARRAY(arrayDescriptor, connection, priceArray);
    callStatement = (OracleCallableStatement) connection
    .prepareCall("{call insert_object.insert_object_prc(?,?)}");
    ((OracleCallableStatement) callStatement).setArray(1, array);
    callStatement.registerOutParameter(2, OracleTypes.ARRAY,
    "APPS.DEPT_ARRAY");
    callStatement.execute();
    ARRAY outArray = callStatement.getARRAY(2);
    Datum[] datum = outArray.getOracleArray();
    for (int i = 0; i < datum.length; i++) {
    oracle.sql.STRUCT os = (oracle.sql.STRUCT) datum[0];
    Object[] a = os.getAttributes();
    for (int j = 0; j < a.length; j++) {
    System.out.print("Java Data Type :"
    + a[j].getClass().getName() + "Value :" + a[j]
    + "\n");
    connection.commit();
    callStatement.close();
    } catch (Exception e) {
    System.out.println("Mapping Error");
    e.printStackTrace();
    THE ERROR
    Mapping Errorjava.sql.SQLException: Inconsistent java and sql object types
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
    at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:823)
    at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1735)
    at oracle.sql.STRUCT.<init>(STRUCT.java:136)
    at com.custom.callable.CallableArrayTryOut.main(CallableArrayTryOut.java:48)

    You posted this question in the wrong forum section. There is one dedicated to Java that was more appropriate.
    Anyway here is a link that describes what you should do.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraarr.htm#i1049179
    Bye Alessandro

  • Creating an array of objects of a class known ONLY at RUNTIME

    I have a method in a class which expects an array of objects of particular type (say A) as its only argument. I 'invoke' this method using reflection. I have the instances of the class A stored in a Vector. When I do 'toArray' on this vector, what I get back is an array of Objects and not an array of objects of A. I assign this array to the zeroth element of another Object array and pass that array as a second argument to the 'invoke' method. Of course, it throws an Exception saying - argument types mismatch. Because I am sending an array of Objects to a method expecting an array of objects of A. My problem is I don't know A until runtime. So I have to handle whatever I am getting back after doing 'toArray' on a vector as a Generic Object. I know there's another version of 'toArray' in the Vector class. But it's API documentation didn't help a lot.
    Can anybody please help me solve this problem? Any sort of hints/code snippet would be of great help.
    Does the above description makes any sense? If not, please let me know. I would try to illustrate it with a code sample.
    Thanks a lot in advance.

    Sorry, for the small typo. It is -
    clazz[] arr = (clazz [])java.lang.reflect.Array.newInstance(clazz, n);
    instead
    Thanks for the reply. I could do this. But I am
    getting a handle to the method to be 'invoke'd by
    looking at the types of the parameters its
    expecting(getParameterTypes). So I can't change it to
    accept an array of Generic Objects.
    I looked at the java.lang.reflect.Array class to do
    this. This is what I am trying to do-
    String variableName is an input coming into my
    program.
    n is the size of the array I'm trying to create.
    Class clazz = Class.forName(variableName);
    clazz[] arr = (clazz
    [])java.lang.reflect.newInstance(clazz, n);
    According to Reflection API, it should work, right?
    But compiler yells at me saying 'class clazz not
    found'.
    Any suggestions/hints/help?
    Thanks, again.

  • Plz help!! array of object (for search)

    i've got few questions of array of object
    1-how to search for a price that is greater than 300 in the array of object
    and how to list all of them?
    2- how to search for the smallest price in the array of object, and how to list?
    can anyone provde a java code for me:P?
    but plz don't too complex
    coz i'm a learner of javaT_T

    _< i still can't understand, and dunno how to change into the code that i needand you guyz help me change it?
    /*wirte the driver program which will define and create an array of
    objects instantiated from the class WaterBill
    Create Accessor and Mutator methods to get/set data from the class.
    write code within the driver method to perfrom the following:
    a) The final total of funds
    b) To search for accounts greater than $300 in the array of objects,
         and list all the customer details
    c)To search for the lowest bill in the array of objects, and list
    those customer dtails
    Class definitions and Objects  using price
    import java.text.*;
    import javax.swing.JOptionPane;
    public class Pre_pb3
         public static void main(String []args)
              int  TTc=0;
              int accNum[]=new int[20];
              String name[]=new String[20], output, stans, display; //stAccNum, stUsage, stTTc;
              double usage[]=new double[20];
              double TTa=0.0;
              double price[]=new double[20];
              char ans;
              double acctG,lowest;
              int i=0;
              waterBill MYwaterBill = new waterBill();
              ans='Y';
              while (!(ans=='N'))
                   name=inputName();
                   accNum[i]=inputAccNum();
                   usage[i]=inputUsage();
                   price[i]=calculateAmountOwing(usage[i]);
                   TTa=MYwaterBill.TTaPrice(price[i]);
                   output=MYwaterBill.outputInfo(name[i], accNum[i], usage[i], price[i]);
                   waterBill MYwaterBill2= new waterBill(name[i], accNum[i],usage[i], price[i]);     
                   stans=JOptionPane.showInputDialog("Do you wanna continue?, (Y)es, (N)o");
                   stans = stans.substring(0, 1);
                   stans=stans.toUpperCase();
                   ans=stans.charAt(0);
                   TTc++;     
              MYwaterBill.outputoutput(TTc, TTa);
              MYwaterBill.findGreat();     //b)
              MYwaterBill.searchDetail();     //c)
              System.exit(0);                                                  
         public static String inputName()
                   String name;
                   name=JOptionPane.showInputDialog("Enter Name ");
                   return name;
         public static int inputAccNum()
              int accNum;
              String stAccNum;
              stAccNum=JOptionPane.showInputDialog("Enter Account Number");
              accNum=Integer.parseInt(stAccNum);
              return accNum;
         public static double inputUsage()
              double usage;
              String stUsage;
              stUsage=JOptionPane.showInputDialog("Enter Water Usage");
              usage=Double.parseDouble(stUsage);
              if (!(usage>=0 && usage<=99999999))
                   System.out.println("water useage is invalid");
                   System.exit(0);
              return usage;
         public static double calculateAmountOwing(double usage)
              double price=0.0;
              if (usage>=0)
                   if (usage<=10000)
                        price=(10000/10)*0.01;
                   else if (usage>10000)
                        price=((10000/10)*0.01)+(((usage-10000)/10)*0.02);
              else
                        System.out.println("Error of usage");
                   return price;
    class waterBill
         private static     int TTc=0 ,accNum=0;
         private static String name, stAccNum, stUsage, stTTc;
         private static String output=" ";
         private static double usage=0.0;
         private static double TTa=0.0;
         private static double price=0.0;
         private static String lowest;
         public waterBill()
              name=" ";
              accNum=0;
              usage=0.0;
              price=0.0;
         public waterBill(String n,int an, double us, double p)
              setName(n);
              setAccNum(an);
              setUsage(us);
              setPrice(p);
         public void setName(String n)
              name=n;
         public void setAccNum(int an)
              accNum=an;
         public void setUsage(double us)
              usage=us;
         public void setPrice(double p)
              price=p;
         public String getName()
              return name;
         public int getAccNum()
              return accNum;
         public double getUsage()
              return usage;
         public double getPrice()
              return price;
         public double TTaPrice(double price)
              TTa=TTa + price;
              return TTa;
         public String outputInfo(String name, int accNum, double usage, double price )
              String output=" ";                         
              output: System.out.println( "Account Number: "+ accNum +
                                       "\nWater Usage: " + usage +
                                       "\nCost Owing: " price
                                       "\nName: "+ name+"\n");
              return output;
         public void outputoutput(int TTc, double TTa)
              display:     System.out.println("Total customer: "+ TTc +
                                  "\nTotal amount owing: " + TTa + "\n\n");
         public void findGreat()//search the a/c that is greater than 300.
              //dunno how to do, so i just leave it blank^^"
              public String searchDetail()//search the smallest a/c
              //same...dunno how to doT_T     

  • Suggestions for increased performance and better memory utilization for FTE

    We all know that there is a pretty big downside to creating potentially thousands of DisplayObjectContainers (TextLines).
    o - they are slow to create
    o - they may be short lived
    o - they occupy lots of memory
    o - they may need to be generated frequently
    Currently, there is only one way to find out all the information you need and that is to create all the TextLines for a given data set.
    This means that FTE does not scale well. It becomes very slow for large data sets that need to be regenerated.
    I am proposing a possible solution and hope that Adobe will consider it.
    If we had the right tools we could create a sliding window of display objects. With large data sets only a fraction of the content is actually visible. So only the objects that are actually visible need to be created. There is no way to do this efficiently with FTE at the present time.
    So we need a few new methods and classes that parallel what you already have.
    New Method 1)
    TextBlock.getTextLineInfo (width:Number, lineOffset:Number, fitSomething:Boolean)  : TextLineInfo
    This method returns simple information about all the lines in a text block. No display objects are generated.
    class TextLineInfo
        public var maxWidth:Number;   // maximum width of all the textlines in the textBlock
        public var totalHeight:Number;  // totalHeight of all the textlines in the textBlock
        public var numLines:int;           // number of lines in the lineInfo Array
        public var lineInfo:Array;           // array of LineInfo items for each textline
    class LineInfo // sample - more or less may be needed
        public var rawTextLength:int;
        public var textWidth:Number;
        public var textHeight:Number;
        public var ascent;
        public var descent;
        public var textBlockBeginIndex:int;
    Now getTextLineInfo needs to be as fast as possible. Find an advanced game programmer to optimize, write it in assembler, put grease on it.... do whatever it takes to make it fast.
    New Method 2)
    TextBlock.createTextLines (textLineInfo:TextLineInfo, begIdx:int, endIdx:int) : Array
    Creates and returns an Array of TextLine objects based on the previously created TextLineInfo. A range can be specified.
    It should be obvious that the above functions will improve the situation. Since this parallels what you already have it should not be earth shaking to implement.
    New Display Object type
    Much of the time you do not need a full blown Display Object Container for a TextLine. I suggest an additional lightweight TextLine class. A good parallel would be similiar to the difference between Sprite and Shape.
    Now I have some done some testing with this idea. Since you cannot implement this fully as it stands, I had to make some concessions. This sample contains 100,004 characters of data. You can resize it and it will always be fast. This sample only creates the visible portion of the display, but you may scroll into view the invisible portions. Each time the page is resized, it will jump back to the top, because of the limitations of FTE currently.
    The sample also contains a caret and allows the selection of an area but no editng, copy, paste  etc., is available for this test.
    If I did not do special handling for this, it would lock up for sure and be very user unfreindly.
    Now it takes a moment to load 100k into the TextElement.so there may be a pause before you see that data. I may need to improve this. Once loaded it performs quite well.
    Without the above or similiar optimizations. FTE is just not going to scale up very well at all.
    Don

    Jeff, I don't see how a fix for that bug means waiting for a major release. It seems it just does not work as you expected and perhaps documented. It should not break any code, should it ? This seems a somewhat major improvement.
    Using recreateTextLine in 10.1 I have these results so far:
    My test case is 668 lines and using my slow test machine so the timing can be picked up.
    When using just createTextLine and creating all text lines:
    ......Using removeChildAt to first remove all the old textLines then create all textLines:
    ..........it takes ~670ms
    ......Removing all children at once by removing the container then create all textLines:
    ..........it takes ~570ms
    Using recreateTextLine, getChildAt, then create all textLines:
    ..........it takes ~670ms
    So recreateTextLine does not improve performance it seems, just better memory I suppose.
    Don

  • Performance and Sprite objects

    I've written an application in Flex 2 that consists of
    several accordions containing custom canvas objects, and it is
    having performance problems.
    I'm running the application within IE 6.0 under Windows 2000.
    The application loads an XML file and uses the data to create
    custom Sprite objects in the canvases. Each Sprite consists of two
    swf images that are loaded using the Loader class, a small
    rectangle created by using the Sprite graphics property, and a text
    label. In addition, each Sprite is connected to one or more other
    Sprites by a line drawn using the Sprite's graphics property. The
    Sprites have the capability for being dragged, and for being
    highlighted when clicked.
    My problem is performance; these Sprites perform slower than
    a similiar program that I wrote in ActionScript 2.0. From what I
    understand, Flex 2.0, ActionScript 3.0, Flash 9, and the new Sprite
    class are supposed to deliver greatly improved performance, but my
    new application seems worse than the old one under Flash 7 using
    MovieClips. The more Sprites on the screen, the worse the
    performance, and the lines seem to contribute to the degradation.
    There is way too much code involved to include in this
    message, so I'm looking for general info. Is there some basic point
    I am missing?
    The performance is also degraded when triggering instances of
    the Menu and Popup classes. When running the Task Manager during
    the application, I've noticed that both Memory Usage and GDI
    objects increase whenever I display a Menu or Popup. Both Memory
    Usage and GDI objects go up and down, but there is a steady
    increase in both metrics as I continue to use Menus and Popups. As
    far as I can tell, I am disposing of both types of objects
    properly, but it appears that their allocation is remaining in
    memory.

    I've written an application in Flex 2 that consists of
    several accordions containing custom canvas objects, and it is
    having performance problems.
    I'm running the application within IE 6.0 under Windows 2000.
    The application loads an XML file and uses the data to create
    custom Sprite objects in the canvases. Each Sprite consists of two
    swf images that are loaded using the Loader class, a small
    rectangle created by using the Sprite graphics property, and a text
    label. In addition, each Sprite is connected to one or more other
    Sprites by a line drawn using the Sprite's graphics property. The
    Sprites have the capability for being dragged, and for being
    highlighted when clicked.
    My problem is performance; these Sprites perform slower than
    a similiar program that I wrote in ActionScript 2.0. From what I
    understand, Flex 2.0, ActionScript 3.0, Flash 9, and the new Sprite
    class are supposed to deliver greatly improved performance, but my
    new application seems worse than the old one under Flash 7 using
    MovieClips. The more Sprites on the screen, the worse the
    performance, and the lines seem to contribute to the degradation.
    There is way too much code involved to include in this
    message, so I'm looking for general info. Is there some basic point
    I am missing?
    The performance is also degraded when triggering instances of
    the Menu and Popup classes. When running the Task Manager during
    the application, I've noticed that both Memory Usage and GDI
    objects increase whenever I display a Menu or Popup. Both Memory
    Usage and GDI objects go up and down, but there is a steady
    increase in both metrics as I continue to use Menus and Popups. As
    far as I can tell, I am disposing of both types of objects
    properly, but it appears that their allocation is remaining in
    memory.

  • Calculating the memory and performance of a oracle query

    Hi,
    I am now developing application in java with oracle as a back-end. In my application i require lot of queries to be executed. Hence, the system is getting is slow due to queries.
    So, i planned to develop one Stand-alone application in java, that should show the statistics like, memory and performance. for ex:- if i enter one SQL query in the text box, my standalone application should display, the processing time it requires to fetch the values and the memory is used for that query.
    Can anybody give ideas, suggestion, etc etc...
    Thanks in Advance
    Regards,
    Rajkumar

    This is now Oracle question, not JDBC question. :)
    Followings are sample for explain plan/autotrace/SQL*Trace.
    (You really need to read stuffs like Oracle SQL Tuning books...)
    SQL> create table a as select object_id, object_name from all_objects
    2 where rownum <= 100;
    Table created.
    SQL> create index a_idx on a(object_id);
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'A');
    SQL>  explain plan for select from a where object_id = 1;*
    Explained.
    SQL> select from table(dbms_xplan.display());*
    PLAN_TABLE_OUTPUT
    Plan hash value: 3632291705
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    PLAN_TABLE_OUTPUT
    | 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| A | 1 | 11 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | A_IDX | 1 | | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    2 - access("OBJECT_ID"=1)
    SQL> set autot on
    SQL> select * from a where object_id = 1;
    no rows selected
    Execution Plan
    Plan hash value: 3632291705
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| A | 1 | 11 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | A_IDX | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("OBJECT_ID"=1)
    Statistics
    1 recursive calls
    0 db block gets
    1 consistent gets
    0 physical reads
    0 redo size
    395 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL> exec dbms_monitor.session_trace_enable(null,null,true,true);
    -- SQL> alter session set events '10046 trace name context forever, level 12';
    -- SQL> alter session set sql_trace = true;
    PL/SQL procedure successfully completed.
    SQL> select * from a where object_id = 1;
    no rows selected
    * SQL> exec dbms_monitor.session_trace_disable(null, null);*
    -- SQL> alter session set events '10046 trace name context off';
    -- SQL> alter session set sql_trace = false;
    PL/SQL procedure successfully completed.
    SQL> show parameter user_dump_dest
    */home/oracle/admin/WASDB/udump*
    SQL>host
    JOSS:oracle:/home/oracle:!> cd /home/oracle/admin/WASDB/udump
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> ls -lrt
    -rw-r----- 1 oracle dba 2481 Oct 11 16:38 wasdb_ora_21745.trc
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> tkprof wasdb_ora_21745.trc trc.out
    TKPROF: Release 10.2.0.3.0 - Production on Thu Oct 11 16:40:44 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> vi trc.out
    select *
    from
    a where object_id = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 1 0 0
    total 3 0.00 0.00 0 1 0 0
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 55
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID A (cr=1 pr=0 pw=0 time=45 us)
    0 INDEX RANGE SCAN A_IDX (cr=1 pr=0 pw=0 time=39 us)(object id 65441)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 25.01 25.01
    Hope this helps

  • Memory and performance crashing 8.2.1

    Hi there,
    On both macOS and window XP the memory and perfomance profiler crashes the complee LV Dev Environment instantly
    once the start button is click.  I update to LV8.2.1f4 same thing.
    Also recently, after more than 5 years developing my application and in use during this period, 24 hours per day, with uptimes of 1- 2 months,  now after a certain number of measurement interations it crashes ( window xp  aplology meassage - ).
    The WinXP event viewer states that my LV app crashed in a third party ActiveX module.
    The ActiveX component has been used unchanged for more than 2 years so I doubt it is the problem, unless some window/lv update has caused it to hang.
    I have carefully examined my code for nto closing refs and file pointers and notification quese that never get emptied/read
    and i believe there are none, but of course i can never rule that out, but it is very minimal likely hood.
    if i watch the memory use of the application in Windows Task manger i do see the memery increase very slowly, but that could also be just more data accumalating - althohg it is not stored in arrays but immediatly to file.
    Any thoughts welcome.
    michael proctor
    Stanford University

    Michael,
    When LabVIEW crashes from running the performance and memory profiler, do you get the CPP error dialog the next time you start LabVIEW?  If so, I would suggest submitting an error report with it.  This will send us the error log file and help us determine what may have happened.
    As for your application, you say this has not been changed and was running for five years, correct?  Has anything else changed on the computer?  Did you recently add new software to the system? 
    How long does it take before the program crashes?  Is the time it takes reproduceable?  How long have you been seeing this behavior?  Did the crashes just suddenly start? 
    In certain cases, shared resource conflicts or corrupt files could cause problems like this.  For XP, this can often be solved by doing a system restore to the time before the crashes started happening.
    Regards,
    Craig D
    Applications Engineer
    National Instruments

  • Running out of cursors, memory and performance

    1. using xsql servlet .9.9.1 command-line with a query that involves cursor expressions, grouping and a join, i run into the following error:
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    </ERROR>
    using a quick program with OracleXMLQuery from XSU 1.2, i get the same error with the same query.
    the database i'm testing is supposed to return 1 million+ rows; only 300 or so can be returned if i specify maxrows to be 300. anything beyond that gives me the cursor error.
    SQL*Plus handles the query just fine.
    2. if i take away the cursor expression in the query, and remove the maxrow spec, i get a java out of memory error.
    3. i can't enhance the performance via using OracleConnection object and wanting to use cursor expressions with XSU at the same time. i get a "protocol error" instead.
    So the questions are:
    1. how can i resolve the cursor issue for the result set size i'm trying to retrieve?
    2. how can i resolve the memory issue for the result set size i'm trying to retrieve? since XSU tries to load the entire result set into memory to build the DOM tree, is it possible to stream it out so that it doesn't have to be capped by memory limitations? if so, do you have sample code i can take a look at?
    3. is it possible to tune the oracle jdbc in conjunction of the use of XSU?
    null

    We are encountering the same problem. We are just inserting via http and no matter how we do things we end up running out of cursors. We are using the production version of the servlet. Have you been able to resolve your problem and do you know if there is a fix. Thanks for any information.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by alfred h:
    1. using xsql servlet .9.9.1 command-line with a query that involves cursor expressions, grouping and a join, i run into the following error:
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    </ERROR>
    using a quick program with OracleXMLQuery from XSU 1.2, i get the same error with the same query.
    the database i'm testing is supposed to return 1 million+ rows; only 300 or so can be returned if i specify maxrows to be 300. anything beyond that gives me the cursor error.
    SQL*Plus handles the query just fine.
    2. if i take away the cursor expression in the query, and remove the maxrow spec, i get a java out of memory error.
    3. i can't enhance the performance via using OracleConnection object and wanting to use cursor expressions with XSU at the same time. i get a "protocol error" instead.
    So the questions are:
    1. how can i resolve the cursor issue for the result set size i'm trying to retrieve?
    2. how can i resolve the memory issue for the result set size i'm trying to retrieve? since XSU tries to load the entire result set into memory to build the DOM tree, is it possible to stream it out so that it doesn't have to be capped by memory limitations? if so, do you have sample code i can take a look at?
    3. is it possible to tune the oracle jdbc in conjunction of the use of XSU?
    <HR></BLOCKQUOTE>
    null

  • Nice to see 13" retina but it has only Intel HD Graphics 4000 and does not have NVIDIA GeForce GT 650M with 1GB of GDDR5 memory card. How it will affect the speed, performance and other things compared to 15" retina where NVIDIA GeForce card is available.

    Nice to see 13" retina but it has only Intel HD Graphics 4000 and does not have NVIDIA GeForce GT 650M with 1GB of GDDR5 memory card. How it will affect the speed, performance and other things compared to 15" retina where NVIDIA GeForce card is available.

    The 15" Retina's will have better performance than any 13" Retina. Not only do the 15" machines have dedicated GPU's, but they also have quad-core processors, whereas the 13" Retina's only have dual-core processors.

Maybe you are looking for

  • Tax code error in Idoc AP

    Hi All        in intercompany customizing, trying to see the posting in the vendor company code after Create the intercompany invoice. The idoc is generated but the status is 51... so posting was not successful ....      I am getting the following er

  • Tolerance group for customer and vendor,

    Hello every one, I NEED your help for testing the vendor and customer tolerance ,recently we configured new tolerance for vendors and customers ,but we are unable to test this new tolerance any know this testing please help we configured  in OBA3.AND

  • Related to Triggers exists in the form

    Hi All, I am working on forms customization.I just want to know the sequence of the firing triggers exists in the form.(Form Level,Block Level,Item Level) Could you please let me know the sequence. Thanks & Regards, Dhanasurya

  • How to get filename with MMDDHHSS

    Hi How can I get file name with extension MMDDHHMM...I know time stamp is availabe but in the target system can only accept 10 characters. Example EL10020120 It there any way I can acheive the same. Regards

  • Going to downgrade from CC to CS5.1, what do I need to do?

    I'm 2 days away from the end of my CC trial, and would like to go back to using my CS5, which I have the serial number and everything for, but is already installed on my Mac as an expired trial period. How do I do this without screwing up? Will I nee