Memory Issue - Handling array of strings in table

Hello Everyone,
       I find trouble in handling a table of strings. The number of rows could vary from 5000 - 10000 whereas the number of columns will be 70. So when I load the string data and view it, labview is consuming much of the memory. Also, I will be performing operations like sorting on this data and will be displaying again. Is there are any alternative or any efficient method for handling this situation?
Thanks,
Vasanth.
Ya Ya

Hi Vasanth,
keep in mind you have 70*5,000(10,000)=350,000(700,000) strings! You have to multiply this number by the length of the strings (and to add some overhead like storing string length for each string...) to get the amount of needed memory .
Sorting this amount of data takes time and requires additional data copies (you probably sort row by row?). And you easily create data copies in memory due to data processing...
Why not use a subset for display? You can make your own scroll bar. This way the user selects the displayed selection of data.
The user scrolls through the data. When he selects an item the index is put into a indicator (using event structure). Then the user can press a button (or select from a ring) to start an action like 'delete'.
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Internal table Memory Issue Exception TSV_TNEW_PAGE_ALLOC_FAILED

    Hi experts,
    I am working on a conversiojn programme. This programme is dealing with 4 input files.
    Each of these files is having more than 50,000 records. I am reading the corresponding application server files to fill
    the internal tables related to these files.
    The files are being read properly and internal tables are being filled.
    However when i try to assign any of these 4 internal tables to other temproray internal tables in programme(requirement)
    i get a dump  TSV_TNEW_PAGE_ALLOC_FAILED.
    The dump is related to memory issue.
    I think The memory available in the programme at this point is not sufficient for table assignment.
    Please suggest any alternatives where i can save any memory .
    Changig of basis setting is not an option.
    Regards,
    Abhishek Kokate

    Hi Kiran,
    I am not agree with you , I am agree with Hermann.
    While writting file you restrict the record max 5,000 to 10,000 records and process don't store the mutch data into internal table.
    After every used refresh the internal table, Declare table where necessary.
    But you can try to avoid the copy cost.
    Rgds
    Ravi Lanjewar

  • How to compare array of String with column of a table

    Hi,
    i have a array of string(say array is of length 1000). I want to
    compare those string in array with one table column
            - whether that table column has a string
                            if yes
                                            do nothing.
                            if no
                                            then insert that string into table.
            - whether table has obsolete row i.e, the one present in table and
    not in array
                            then delete that row.
    How do i go about this, because i see, it is not feasible to loop
    through array and search table to find new string OR loop through each
    row from table to find some obsolete row
    How can i accomplish this task more feasibly(without running query for
    each string, for comparission)? Is there any way to find this kind of
    problem. I would have been easy if i had to compare two tables(with
    UNION and INTERSECT), but it is not the case.
    thanks,
    kath.

    I'm not sure, whether I understand your problem correctly. Only two comments:
    - if both arrays are sorted, all can be done running exactly once simultaneously through both arrays.
    - if the column is marked as UNIQUE, all column strings will be different. I.e. you cannot insert the same string a second time.
    Regards  Thomas

  • Memory issue LabVIEW won't deallocte

    Hello,
    I was wondering if anyone could help. I am running LabVIEW 2012 and playing with manipulating data from a reasonably large file 40Mb using a lot of String Arrays.
    Everything runs ok, the problem I am having is that everytime I run the VIs associated with the program, even when I shut them down LabVIEW is keeping them in memory, so my Ram usage is going up to about 3GB each time and I cannot get it to reduce without shutting down LabVIEW which is reallly started to prove frustrating. I have put in a few de-allocation elements but that doesn't seem to be solving it. I was just wandering if anyone know a magic command to deallocate all VIs in LabVIEWs memory without me having to shut down completely.
    I know I could make the whole thing more memory efficient by not using String arrays and instead just using a single string but that is not the problem as each VI individually handles it fine and I dont have any indicators on my top level VI which would be holidng it up?
    Any ideas welcome.
    Thanks!

    Sorry, I will have to study this later, but just glancing at it shows quite a few questionable things:
    in snipped.png:
    the "time taken" will most likely show always zero, because both frames execute in immediate succession, in parallel to the rest of the code. what is the purpose?
    reshaping a 2D array to a 1D array could be done with the "reshape" primitive. Doing a sucessive "array to spreadsheet string" followed by "spreadsheet string to array" seems very Rube Goldberg. 
    The entire code is a constant dance between different representations (1D array, 2D array, cluster, cluster array, spreadsheet string, etc.) Are you sure this could not be done a bit simpler?
    In snippet 2.png:
    "request deallocation" does not care about execution order, so placing it inside a sequence frame is meaningless.
    LabVIEW Champion . Do more with less code and in less time .

  • Result Set Causing out of memory issue

    Hi,
    I am having trouble to fix the memory issue caused by result set.I am using jdk 1.5 and sql server 2000 as the backend. When I try to execute a statement the result set returns minimum of 400,000 records and I have to go through each and every record one by one and put some business logic and update the rows and after updating around 1000 rows my application is going out of memory. Here is the original code:
    Statement stmt = con.createStatement();
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                System.out.println("doing some logic here");
    rs.close();
    st.close();
    I am planning to fix the code in this way:
    Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY,
                          ResultSet.CONCUR_UPDATABLE);
    stmt.setFetchSize(50);
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                System.out.println("doing some logic here");
    rs.close();
    st.close();But one of my colleague told me that setFetchSize() method does not work with sql server 2000 driver.
    So Please suggest me how to fix this issue. I am sure there will be a way to do this but I am just not aware of it.
    Thanks for your help in advance.

    Here is the full-fledged code.There is Team Connect and Top Link Api being used. The code is already been developed and its working for 2-3 hours and then it fails.I just have to fix the memory issue. Please suggest me something:
    Statement stmt = con.createStatement();
    ResultSet   rs = st.executeQuery("Select * from  database tablename where field= 'done'");
                while(rs!=null && rs.next()){
                 /where vo is the value object obtained from the rs row by row     
                if (updateInfo(vo, user)){
                               logger.info("updated : "+ rs.getString("number_string"));
                               projCount++;
    rs.close();
    st.close();
    private boolean updateInfo(CostCenter vo, YNUser tcUser) {
              boolean updated;
              UnitOfWork unitOfWork;
              updated = false;
              unitOfWork = null;
              List projList_m = null;
              try {
                   logger.info("Before vo.getId() HERE i AM" + vo.getId());
                   unitOfWork = FNClientSessionManager.acquireUnitOfWork(tcUser);
                   ExpressionBuilder expressionBuilder = new ExpressionBuilder();
                   Expression ex1 = expressionBuilder.get("application")
                             .get("projObjectDefinition").get("uniqueCode").equal(
                                       "TABLE-NAME");
                   Expression ex2 = expressionBuilder.get("primaryKey")
                             .equal(vo.getPrimaryKey());// primaryKey;
                   Expression finalExpression = ex1.and(ex2);
                   ReadAllQuery projectQuery = new ReadAllQuery(FQUtility
                             .classForEntityName("EntryTable"), finalExpression);
                   List projList = (List) unitOfWork.executeQuery(projectQuery);
                   logger.info("list value1" + projList.size());
                   TNProject project_hist = (TNProject) projList.get(0); // primary key
                   // value
                   logger.info("vo.getId1()" + vo.getId());
                   BNDetail detail = project_hist.getDetailForKey("TABLE-NAME");
                   project_hist.setNumberString(project_hist.getNumberString());
                   project_hist.setName(project_hist.getName());
                   String strNumberString = project_hist.getNumberString();
                   TNHistory history = FNHistFactory.createHistory(project_hist,
                             "Proj Update");
                   history.addDetail("HIST_TABLE-NAME");
                   history.setDefaultCategory("HIST_TABLE-NAME");
                   BNDetail histDetail = history.getDetailForKey("HIST_TABLE-NAME");
                   String strName = project_hist.getName();
                   unitOfWork.registerNewObject(histDetail);
                   setDetailCCGSHistFields(strNumberString, strName, detail,
                             histDetail);
                   logger.info("No Issue");
                   TNProject project = (TNProject) projList.get(0);
                   project.setName(vo.getName());
                   logger.info("vo.getName()" + vo.getName());
                   project.setNumberString(vo.getId());
                   BNDetail detailObj = project.getDetailForKey("TABLE-NAME"); // required
                   setDetailFields(vo, detailObj);//this method gets the value from vo and sets in the detail_up object
                   FNClientSessionManager.commit(unitOfWork);
                   updated = true;
                   unitOfWork.release();
              } catch (Exception e) {
                   logger.warn("update: caused exception, "
                             + e.getMessage());
                   unitOfWork.release();
              return updated;
         }Now I have tried to change little bit in the code. And I added the following lines:
                        updated = true;
                     FNClientSessionManager.release(unitOfWork);
                     project_hist=null;
                     detail=null;
                     history=null;
                     project=null;
                     detailObj=null;
                        unitOfWork.release();
                        unitOfWork=null;
                     expressionBuilder=null;
                     ex1=null;
                     ex2=null;
                     finalExpression=null;
    and also I added the code to request the Garbage collector after every 5th update:
    if (updateInfo(vo, user)){
                               logger.info("project update : "+ rs.getString("number_string"));
                               projCount++;
                               //call garbage collector every 5th record update
                               if(projCount%5==0){
                                    System.gc();
                                    logger.debug("Called Garbage Collectory on "+projCount+"th update");
                          }But now the code wont even update the single record. So please look into the code and suggest me something so that I can stop banging my head against the wall.

  • Programmatically changing string text color in an array of string indicators

    Hi,
    I have an array of string indicators and I'm trying to format certain values different colors.  While I'm able to do this on a single string indicator I can't figure out how to handle the indexing of the array.  I have seen several examples with array of clusters but I am unable to translate to array of string indicators.
    Any help would be appreciated.
    Regards,
    ShotSimon
    Attachments:
    Changing text color in an array of string controls.vi ‏9 KB

    Instead of a string array, where all elements have the same format, you should use a table, which basically behaves as a 2D string array. But there, you can adjust all text attributes (if you are using LV 8.x). See this thread
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How do I resize an array of strings in a CIN ?

    I've been using a call to NumericArrayResize() to allocate enough memory for numeric arrays, but I now have an array of strings that I need to build in a DLL/CIN and pass back to Labview. Can someone point me to a snippet that will demonstrate how to populate an array of strings with data?
    Kindest,
    Warren

    Check the follwing example. It may be what you want:
    Using a CIN to Create an Array of Strings in LabVIEW
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&AD517F5DCCAF70228625683A000A570F&cat=2F4F574886553A62862567AC004F032D
    Also, check the following example, as it provide an example on how to handle strings.
    Code Interface Node (CIN) That Converts a LabVIEW String to a C String, Modifies it, and Returns it as a LabVIEW String
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&D978409908EA760D8625683A000B6B6E&cat=2F4F574886553A62862567AC004F032D
    Regards;
    EV
    www.vartortech.com

  • How to get itemChild Array from plist into table 2 ?????

    Hi there,
    I am creating a project for the IPhone, using UITableViews.
    I have been looking at James' code and trying to adapt it.
    My project has two tableviews, and two tableview controllers. THe plist is an Array of dictionaries and each dictionary houses a name string and an ItemChild Array.
    The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
    here is the shape of the plist.
    <array>
    <dict>
    <key>name</key>
    <string>Category A</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    <dict>
    <key>name</key>
    <string>Category B</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    <dict>
    <key>name</key>
    <string>Category C</string>
    <key>ItemChild</key>
    <array>
    <string>aaaa</string>
    <string>bbbb</string>
    <string>cccc</string>
    <string>dddd</string>
    </array>
    </dict>
    </array>
    </plist>
    here are the implementation files for the first and second tableviewControllers
    @implementation TableTutViewController
    @synthesize dataList1;
    - (void)viewDidLoad {
    [super viewDidLoad];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"newData" ofType:@"plist"];
    NSMutableArray* tmpArray = [[NSMutableArray alloc]
    initWithContentsOfFile:path];
    self.dataList1 = tmpArray;
    [tmpArray release];
    #pragma mark -
    #pragma mark Table view data source
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return dataList1.count;
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
    reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
    objectForKey:@"name"]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    #pragma mark -
    #pragma mark Table view delegate
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SecondViewController *secondViewController = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    secondViewController.dataList1 = [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
    [self.navigationController pushViewController:secondViewController animated:YES];
    [secondViewController release];
    #pragma mark -
    #pragma mark Memory management
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    - (void)viewDidUnload {
    - (void)dealloc {
    [super dealloc];
    @end
    And here is the code for the secondViewController
    #import "SecondViewController.h"
    #import "TableTutAppDelegate.h"
    #import "TableTutViewController.h"
    @implementation SecondViewController
    @synthesize dataList1;
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    - (void)viewDidUnload {
    #pragma mark Table view methods
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [self.dataList1 count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.textLabel.text = [[self.dataList1 objectAtIndex:indexPath.row]
    objectForKey:@"ItemChild"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    - (void)dealloc {
    [dataList1 release];
    [super dealloc];
    @end
    Any idea's on what is missing would be great. Do I need to create a new array to put the itemChild array into before loading it into the cell.textLabel.text??
    Any help would be fantastic,
    thanks
    Alex
    Message was edited by: alex200

    Hey Alex, welcome to the Dev Forum!
    alex200 wrote:
    I have been looking at James' code and trying to adapt it.
    Have you been looking at James as well? I'm wondering if you two are at the same school.
    The dictionary names go into the first table no problem but I can get the ItemChild Arrays into the second table.
    Actually you passed the ItemChild arrays correctly (assuming dataList1 is declared as shown), but when you wanted the name for each element, you forgot that ItemChild was an array of strings, not an array of dictionaries:
    // SecondViewController.h
    @interface SecondViewController : UITableViewController {
    NSMutableArray *dataList1;
    @property (nonatomic, retain) NSMutableArray *dataList1;
    @end
    // SecondViewController.m
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    cell.textLabel.text = [self.dataList1 objectAtIndex:indexPath.row]; // <-- dataList1 is an array of strings
    // objectForKey:@"ItemChild"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    Other than the above, there wasn't much to correct. I just set the title of the first controller's nav item, since that's needed to display the default return button in the second controller's nav bar (but you probably had set that title in IB), and I also passed the name of the selected Category row to the second controller's nav item:
    // TableTutViewController.m
    - (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"Categories"; // <-- added in case title isn't in xib
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SecondViewController *secondViewController = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    secondViewController.dataList1 =
    [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"ItemChild"];
    secondViewController.navigationItem.title =
    [[self.dataList1 objectAtIndex:indexPath.row]objectForKey:@"name"]; // <-- add title
    [self.navigationController pushViewController:secondViewController animated:YES];
    [secondViewController release];
    Overall it looks like you did a nice job. I think ItemChild was an array of dictionaries in James' plist, so that might be the reason your code matched his plist instead of yours.
    - Ray

  • Sorting an array of Strings

    Okay, my first concern is that I'm pretty new to Java. It's my first language that I've ever looked at, and I'm just getting into it.
    I'm trying to read from a .txt file a name and an integer value associated with that name, like for instance, Jimmy Bob Jones 123. I have several lines of different names with different integers associated with each, sorted alphabetically in the .txt file to begin with. That's not the issue really--though I haven't figured out how to do that, I figure it's pretty simple compared to what I have to do with those. I set each line as a new element in an array of Strings, and then I want to sort them based on the value of the integer that follows each. I know that each integer is 5 digits, so I'm thinking about some way to sort based on Integer.parseInt(name.substring(name.length - 5, name.length)) for each element, but it's not coming to me.
    I mean, let's say I have the following in a .txt file:
    Abigail 32534
    Bo 28935
    Chris 45000
    Damian 13777
    And I feed those into my .class and set each line to an array element, so it would be like arrayName[0] = "Abigail 32534" etc. for each. Convoluted question, sorry. How would I sort those strings based solely on the integer values, yet also retain the name that goes along with it?
    Any help is appreciated, though I don't guarantee I'll understand : )

    One easy (such a relative term) way is to create an Object, such as NameAndNumber, which has two member variables (name and number). When you read in your file, create objects of this type.
    As for the sorting, this is a two step process:
    1) Create a Comparator class to compare your objects
    2) Populate a TreeSet which uses this comparator.
    The TreeSet will be sorted automatically (based on your Comparator) and you can then iterate through it to retrieve instances of your object.
    This all sounds much more complicated than it is. I have written some code to get you started.
    // Your class
    public class NameAndNumber {
      private int m_nNumber;
      private String m_sName;
      // sets the name
      public void setName(String sName) {
        m_sName = sName;
      // gets the name
      public String getName() {
        return m_sName;
      // sets the number
      public void setNumber(int nNumber) {
        m_nNumber = nNumber;
      // gets the number
      public int getNumber() {
        return m_nNumber;
    // Your comparator
    public class MyComparator implements Comparator {
      // required by interface
      public int compare(Object obj1, Object obj2) {
        // throws ClassCastException if there is a problem - you will need to add
        // handling if this is an issue
        NameAndNumber objNan1 = (NameAndNumber) obj1;
        NameAndNumber objNan2 = (NameAndNumber) obj2;
        // will return the proper comparison based on the number
        return (objNan1.getNumber() - objNan2.getNumber());
    // Inside your "main" class
    TreeSet setNumbers = new TreeSet(new MyComparator());
    NameAndNumber objNameAndNumber = getNextListing(); // you need to provide this method, which gets the items one at a time
    setNumbers.add(objNameAndNumber);Hope this helps.

  • How to correct internal memory issue

    This is related to the standard SAP program SAPRCKM_MR11 in which there is one include RCKM_MR11F01 which contains a select statement :
    SELECT *
         INTO CORRESPONDING FIELDS OF TABLE t_bhistory
         FROM v_ckmlgrir
         WHERE bukrs EQ p_bukrs
         AND   ebeln IN r_ebeln
         AND   ebelp IN r_ebelp
         AND   lifnr IN r_lifnr
         AND   ekorg IN r_ekorg
         AND   ekgrp IN r_ekgrp
         AND   werks IN r_werks
         AND   bedat IN r_bedat
         AND   bsart IN r_bsart
         AND   bstyp IN ht_bstyp
         AND   vgabe IN ('1', '2', '3')  "Wareneingang/Rechnung/Nachbel.
         AND   loekz_k NE 'L'            "Loeschkz. Bestellkopf
         AND   loekz_p NOT IN ('L', 'S') "Loeschkz. Bestellposition
         AND ( frgrl   EQ space          "Freigabe unvollständig
         OR    frgrl   IS NULL )
         AND ( memory  EQ space          "Bestellung noch nicht komplett
         OR    memory  IS NULL )         "falls Feld nicht initialisiert
         AND ( xwoff   EQ space          "Wertbildung offen
         OR    xwoff   IS NULL )         "falls Feld nicht initialisiert
    bei Dienstleistungsbestellungen werden mehrfach kontierte
    Bestell-Pos. gegen das WE/RE-Konto gebucht, deshalb dürfen
    mehrfach kontierte Pos. nicht generell überlesen werden.
          AND   vrtkz   EQ space          "keine Mehrfachkontierung
         AND   wepos   EQ 'X'            "Wareneingang wird erwartet
         AND   repos   EQ 'X'            "Rechnung wird erwartet
         AND   weunb   EQ space          "Wareneingang unbewertet
         AND   stapo   EQ space.         "Item is not statistical
    There is one job FMT612P which contains this standard program and the job is going to abend
    because of the select statement given above which is because of some memory issue with the internal table t_bhistory, please give us a suggestion how we can avoid the same.

    Hi,
    I am also facing the same issue. We had copied this report into a custom report and are trying to improve performance by breaking the view into separate queries on EKKO, EKPO and EKBE.
    Can someone advise the best way to deal with this view v_ckmlgrir or a best approach to break down the view into separate queries.
    Thanks
    Edited by: Shreyas Shrikant Kulkarni on Jun 29, 2009 4:56 PM

  • How do I write an array of strings to a single Excel row?

    I'd like to write test data, as an array of strings, to an Excel file. Attached is my attempt to modify one of the Labview 6.1 example files. This modified example will write the data to the correct row, which is determined by serial # of the UUT, but to a new sheet for each unit. I'd like to do the same thing, but to just one sheet. This sheet's data would then be saved after 50 rows of collected test data.
    Thank you in advance,
    Tim Denson
    Attachments:
    Write Table To XL.vi ‏58 KB

    Sorry I didn't get back to faster on this. I've been out of town working and just really haven't had time.
    Yes,
    The Report Generation toolkit would make this very easy. If you have it, I'd suggest using it.
    The image shown below shows the five VIs from the toolkit that I've used to write to Excel.
    What this loop does is receive a string through a Queue, either open a
    template or open todays file, convert the tab delimited string to an
    array, write the array to the next line of the Excel file, Save (with
    todays date stamp if opened from the tempate) and close it. It's a good
    idea to always save and close teh file after each write if it's not
    being continuously written to. In this case, a new line will be written
    only once a minute or so. This lessens the chance of losing data if the
    machine locks up for some reason. Opening and closing does take time
    and can slow down a loop that needs to run at a certain rate. This loop
    actually runs in a background process and several other processes send
    data to it through the queue to be written. The queue can buffer
    several data streams if needed so you won't lose data if it's busy and
    you don't have to worry about two processes accessing the Excel sheet
    at the same time.
    Ed
    Message Edited by Ed Dickens on 02-18-2006 11:12 AM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    RGTK Array to Excel.gif ‏14 KB

  • Is there a way to type cast an array of strings to numbers and back again?

    I'm working on an application where I want to type cast a string like "power supply" into an array of existing numbers. Then sort the existing numbers, and finally convert the casted numbers back into a string so it can be read by the user. In the attachment, you can see my latest attempt with flatten/unflatten data and the 'convert string to byte array'. I can't seem to make this work. Any ideas?
    Thanks - Paul
    Attachments:
    Paul's Temp scan for components.vi ‏56 KB

    OK, here's a quickie (LabVIEW 7.0).
    Simply get the sort key from the 1D array, then build the table.
    Message Edited by altenbach on 10-27-2006 01:34 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SortedTable.png ‏4 KB
    SortedTable.vi ‏37 KB

  • Memory issues while fetching content

    HI all,
    I am using SAP KM Apis. however i am facing some memory issues while using them.
    I am using getContent() api on a resource. and then getInputStream on the Icontent object. I am using a ByteArrayOutputStream for writing the data. here is the code snippet:
    byte[] buf= new byte[4096];
    InputStream inputStream = content.getInputStream();
    ByteArrayOutputStream os = new ByteArrayOutputStream(1024)
    while ((count = inputStream.read(buf)) != -1)
        os.write(buf, 0, count);
    byte[] arr=os.toByteArray();
    THis code consuimes a lot of memory . we need to optimize this. we also tried removing BYteArrayOutputSteam and directly read the bytes in chunk :
    int n; 
    do 
         n = inputStream.read(buf, 0,(int)content.getContentLength()); 
    while (n != -1); 
    however this approach has not helped us.
    please suggest an approach where memory consumption is less and the entire content is fed.
    thanks

    Hi
    This code worked for me for reading from a KM res...
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    StringBuilder sb = new StringBuilder();
    String line = null;
            try {
                while ((line = reader.readLine()) != null) {
                    sb.append(line + "\n");
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
    return sb.toString();
    Regards
    BP

  • Memory issues in java3d1.2(openGL ver) and 1.2.1-03 sdk(openGL ver)

    hi ,
    i am working in java 3d and handling memory issues .I have made following observations.
    In java3d 1.2 version,when we close a primitive ,(transform group,point3d,transform 3d release) about 80% of memory used by the primitive when it was opened.but point4d releases only 2% of memory.
    on a contrary when i use java3d1.2-03 sdk point4d releases about 75% of memory and others(transform3d,transform group,point3d ) releases about 40% of memory allocated to them.
    can somebody tell me if there is some kind of difference in these two versions related to memory?or is there any memory bug in the later version?
    thanks
    sangeeta

    hi,
    We r using memory management tools like Jprobe and optimizer IT to count the rate of memory released.
    Thanks
    sangeeta

  • Mapping lookup up failure with input JavaBean with an array of strings

    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
         at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
         at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
         at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
         at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
         at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
         at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
         at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
         [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
         private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
         private String nodeId = null;
         private String incidentNbr = null;
         private String CSRCode = null;
         private String[] stopCodes = null;
         public void setStopCodes(String[] aStopCodes) {
              stopCodes = aStopCodes;
         public String[] getStopCodes() {
              return stopCodes;
         [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
         <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
         ejbJar="GIMServiceEJB.jar"
         targetNamespace="ncr.com"
                        serviceName="GIMService"
                        serviceURI="/GIM_URI"
                        generateTypes="True"
                        expandMethods="True"
                        style="rpc"
                        protocol="http" >
              <client
                   clientJarName="GIMService_client.jar"
                   packageName="com.ncr.gim.gimservice.client" >
              </client>
    </service>
    </servicegen>
    </target>
    </project>

    Hi Jeff,
    Looks like the Perl client is using an older (deprecated) schema
    namespace "http://www.w3.org/1999/XMLSchema" that is causing this
    failure.
    Hope this helps,
    Bruce
    Jeff Carey wrote:
    >
    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
    at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
    at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
    at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
    at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
    at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
    at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
    at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
    at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
    at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
    at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
    [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
    private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
    private String nodeId = null;
    private String incidentNbr = null;
    private String CSRCode = null;
    private String[] stopCodes = null;
    public void setStopCodes(String[] aStopCodes) {
    stopCodes = aStopCodes;
    public String[] getStopCodes() {
    return stopCodes;
    [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
    <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
    ejbJar="GIMServiceEJB.jar"
    targetNamespace="ncr.com"
    serviceName="GIMService"
    serviceURI="/GIM_URI"
    generateTypes="True"
    expandMethods="True"
    style="rpc"
    protocol="http" >
    <client
    clientJarName="GIMService_client.jar"
    packageName="com.ncr.gim.gimservice.client" >
    </client>
    </service>
    </servicegen>
    </target>
    </project>

Maybe you are looking for