List to big for array

I am attempting to place more than 135,000 indexed objects into an array called moveNBH. The array cannot handle that number of objects. I keep getting the memoryOutOfBounds error. ANy ideas how to instantiate a data structure taht accepts that many objects (and more!)
Thank you.
public void mvNBH() {     //read in neighborhood
     String fname = "D:/myprojects/bays29_1_7_11_14.txt";
    try   {
      FileInputStream fis = new FileInputStream(new File(fname));
      StreamTokenizer stream = new StreamTokenizer(new BufferedReader(new InputStreamReader (fis)));
      stream.eolIsSignificant(true);
      String kjNBH = "";
      StringBuffer temp = new StringBuffer("");
      int numCity = 0;
      stream.nextToken();
      int city = (int)stream.nval;
      stream.nextToken();
      int nbhd = (int)stream.nval;
      stream.nextToken();
      System.out.println("Number of cities= " + city + "  Size of neighborhood= " + nbhd);
      while(stream.nextToken() != stream.TT_EOF) {
        if (numCity < city) {
          temp.append((int)stream.nval);
          temp.append(" ");
        else {
          numCity=0;
          stream.nextToken();
          temp.append((int)stream.nval);
          temp.append(" ");
          }       // end else
        numCity++;
        }        // end while now EOF
      kjNBH = temp.toString();
      String item = "";
      int nbIndex = 0;
      StringTokenizer tokens = new StringTokenizer ( kjNBH );
      for(int j=0; j < nbhd; j++) {
        int[] gapArray = new int [city];
        for (int i=0; i < gapArray.length; i++) {
          item = tokens.nextToken();
          Integer k = Integer.valueOf(item);
          gapArray[i] = k.intValue();
        moveNBH.add(j, gapArray);
        gapArray = null;
        }   //end add new array
      }   //end try
    catch (Exception e) {
      e.printStackTrace();
      }  //end catch
    } //end build neighboorhood  

The article at the link shown below shows you how to increase the amount of memory for your java application (assuming you have enough physical memory).
http://developer.java.sun.com/developer/TechTips/2000/tt1222.html
V.V.

Similar Messages

  • ODI-40406: Bytes are too big for array error

    Hello ,
    I am trying to load a flat file from a table. I am working on ODI 11G.
    Following are performed.
    Staging area different from SOurce is checked.
    IKM used is : IKM SQL to File Append
    Truncate is True
    No LKM is used.
    I am getting following error:
    java.lang.IllegalArgumentException: ODI-40406: Bytes are too big for array
    create header (RECORDTYPE,
    ASSIGN_NUM,
    USR_ID,
    START_TIME,
    JOBCODEID,
    AISLE_AREA_ID,
    PLANE_DATE,
    CLIENT_ID,
    CSTNUM,
    WH_ID)
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=UNITIME TO RPSNP$CRLOAD_FILE=C:\Program Files\ODI_BI_APPS/UNITIME TO RP.txtSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP

    There is a possibility of mismatch of datatype, that can cause the problem.
    Say in ODI model, you have defined a 'Date type' field to be stored as 'String' however at the time of mapping in 'Interface', no conversion happens (from date to string)  for this particular object. This causes the problem.
    The original query remains valid at DB side (fires for datetype) however fails while integrating (anticipating String which may be longer than defined in modelbecause of your NLS setting in DB). Therefore the best way would be to apply conversion for that particular field (in this case, use TO_CHAR(Date type,'Desired Date Format').

  • ODI-40406: Bytes are too big for array

    I am getting the following error: java.lang.IllegalArgumentException: ODI-40406: Bytes are too big for array
    I am trying to a file to file mapping and all of my columns match in size. Does anyone have any ideas what this problem could be? I am getting an error when it tries to perform an integration step while trying to create the target table. I am assuming it is something wrong with one of my datastores
    Edited by: 897642 on Nov 16, 2011 5:19 PM

    There is a possibility of mismatch of datatype, that can cause the problem.
    Say in ODI model, you have defined a 'Date type' field to be stored as 'String' however at the time of mapping in 'Interface', no conversion happens (from date to string)  for this particular object. This causes the problem.
    The original query remains valid at DB side (fires for datetype) however fails while integrating. Therefore the best way would be to apply conversion for that particular field (in this case, use TO_CHAR(Date type,'Desired Date Format').

  • My CS3/PS has started to change the cursor into a line of three VERY small icons when dragged over a picture or menu. Thus it is VERY difficult for instance to drag a layer in the layer list to the wastebasket - the cursor simply is too big for the waiste

    My CS3/PS has started to change the cursor into a line of three VERY small icons when dragged over a picture or menu. Thus it is VERY difficult for instance to drag a layer in the layer list to the wastebasket - the cursor simply is too big for the waistebasket icon. Even all other exact work is impossible.  Of course I have checked all the cursor presets but nothing seems to help. My OS is Windows7.

    Have you tried resetting Preferences?
    A logical next step would be to reset your Preferences.
    To reset Preferences:
    If Photoshop is already open on your screen, close it (Quit). Then hold down Shift+Ctrl+Alt (Win) / Shift+Command+Option (Mac) on your keyboard and start Photoshop.
    A dialog box will pop up asking if you want to delete the existing Preferences file (the "Settings"). Click Yes in the dialog box. The existing Preferences file will be scrapped and a new one will be created.

  • How Do You Populate A Spark List Control With An Array?

    Hello, all,
    Sorry to come accross so frustrated, but how in the name of God do you populate a Spark list control with the data in an array?  You used to be able to do this with the mx:List control, but the guys developing Flex just had to make things more difficult than they need to be!  I am more of a code purist and prefer doing things the way they have been done for decades, but apparently nothing can ever stay simple!
    I simply want to populate a list control with an array and this shouldn't be rocket science!  I found out that I must use a "collection" element, so I decided that an arrayCollection would be best.  However, after searching Adobe's documentation about arrayCollections, I am lost in a black hole of data binding, extra lines of code just to add a new element, the need to sort it, etc...!
    Here is my code:
    var pendingArray:ArrayCollection = new ArrayCollection();
    for ( var i:int = 0 ; i < queue.length ; i++ )
         var item:UserQueueItem = queue[i] as UserQueueItem ;
         if ( item.status == UserQueueItem.STATUS_PENDING )
         pendingArray.addItem({label:item.descriptor.displayName,descriptor:item.descriptor});
    Here is the relevant MXML:
    <s:VGroup>
         <s:List id="knockingList" width="110" height="100"/>              
    </s:VGroup>
    I'm not getting any errors, but the list is not populating.
    I have seen several examples where the arrayCollection is declared and populated in MXML:
            <mx:ArrayCollection id="myAC">
                <!-- Use an fx:Array tag to associate an id with the array. -->
                <fx:Array id="myArray">
                    <fx:Object label="MI" data="Lansing"/>
                    <fx:Object label="MO" data="Jefferson City"/>
                    <fx:Object label="MA" data="Boston"/>
                    etc...
               </fx:Array>
            </mx:ArrayCollection>
    That may be fine for an example, but I think this is a rare situation.  Most of the time I would image that the arrayCollection would be created and populated on the fly in ActionScript!  How can I do this?
    Thanks in advance for any help or advice anyone can give!
    Matt

    In your post it seemed like you were trying to take care of many considerations at once: optimization, design, architecture.  I would suggest you get something up and running and then worry about everything else.
    If I use data binding, then I will probably have to declare the  arrayCollection as a global variable and then I'll have to write 100 or  so extra lines of code to addItem(), removeItem(), sort(), etc...  It  just seems like too much overhead.
    I believe you may have some misconceptions about databinding in general.  You won't have to make it a global variable and you certainly won't need an extra 100 lines of code.  If you did this forum would be a very , very quiet place.
    I don't want to use data binding because the original array is refreshed  often and there is one function called by an event that re-declares the  arrayCollection each time, populates it with the array, and then sets  it as the list's dataprovider.
    That is the beauty of the ArrayCollection, it can handle the updates to its source Array. I don't know if you need to redeclare the ArrayCollection, resetting the source to the new Array allows everyone involved to keep their references so you don't have to worry about any "spooky" stuff going on.

  • What is the best way to make a list of addresses for envelopes or labels?  Address book, numbers or pages?

    What is the best way to make a list of addresses for envelopes and labels?  Address book, Pages or Numbers?

    I liek your idea of having multiple images in a grid. I think
    that would be the best bet as you mentioned. Having one big picture
    would be hard to distinguish the sub-areas with mouse coordinates.
    I think checking the coordinates for the mouse would be very
    tedious because I would have to check for the left boundary, the
    right, top, and bottom for each sub-area!
    What do you mean by using button components and reskinning.
    Is this simply using buttons and changing the way they look? I'm
    just trying to save time and memory, because if I had a 10 by 10
    grid, thats a hundred buttons. Wouldn't that slow down the machine
    alot? And for that matter wouldn't having a grid of 10 by 10 images
    also by the same deal?
    Thanks for the input, I'm just trying to find the most
    efficient way to do it.

  • Java 1.5 - Each Element of a List Cannot Be An Array?

    I plan to create a List and each element of this List is a String Array.
    First, I declared a List:
         private static List<String> recursiveTextArray = new ArrayList<String>();And I want to build this List by adding one Array at a time:
    recursiveTextArray.add( title );where
    private String[] title;
    title = new Array(3);I got syntax error saying: "The method add(String) in the type List<String> is not applicable for the arguments (String[]).
    I cannot figure out what the compiler is complaining about. How do I fix the problem? Thanks in advance.

    I think that I have some idea about what is going on. Because Array is an object, I should:
    private static List<Object> recursiveTextArray = new ArrayList<Object>();But the Java statement shown right above has a syntax error: "Syntax error on token ";", , expected"
    I have no clue why there is such a syntax error.

  • Create a list or container for states of a statemachine

    Hi,
    I am working on an application where several different types of devices will be put into a test fixture for board level testing.  Based on the type of board, i need to create an ordered list of all of the tests necessary for the device.  I have a state machine and a unique state for each of the tests and am trying to figure out how to create a list of tests for the specific device.  I want to have a check in each of the states to remove the first item of the list and then take the next value and wire it to the shift register used to go from state to state.  This should allow the state machine to switch to the appropriate state based on the device type and its necessary test sequence.
    Should this be implemented with an array?  Is there some easier container to work with for this use case?  I need a container that will allow me to easily add between 5 and 30 state names (based on the needs of the device type) and easily remove them or increment a pointer to the next state in the container.
    Thanks,
    Gary
    Solved!
    Go to Solution.

    I would avoid using the stacked sequence at all cost. This is not a very good approach to the solution. How are you determining which tests need to be run at which time? I would use a loop to enqueue the desired tests. You can use a separate table (which could be initialized from an external source such as an ini file) which defines all your available tests, hich hardware they apply to and the order they would need to be run. When your specific hardware is selected you can iterate over the table and select the tests that need to be executed. Using the state machine is still a good idea since it allows you to interrupt the exection as well as insert or include other general tasks that may be required during the tests.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • Report for list of POs for with Invoice has not been posted

    Hi All
    Can anybody tell me the report for list of PO' for which GR has already been done but Invoice is not posted
    Thnks
    Ranjith

    Hi
    Try Report ME2M,
    With input selection parameter  "WE101".
    Hope this helps.
    Harish

  • When I open my iPad the page is too big for the screen and won't shrink down. The keypad has also become very 'sticky'

    Recently when I open any apps the pages are too big for the screen. They shrink when pinched but immediately become bigger again. It's very difficult to scroll too. The keypad has become very sticky. Missing letters and spaces when I type and needing to tap the keys much harder than usual

    I have the exact same problem, I think.  I was on my iPad 3's home page swiping R-L to locate a certain icon when all of a sudden the screen appeared to get HUGE.  So big I could only see one or two icons.  I couldn't even turn it off to try a reboot because after I pushed the sleep/wake button, I couldn't find the red slide bar.  I finally just had to wait for the battery to die, then recharge it, and it looked normal again.  I also spoke with several friends who haven either iPads or iPhones, and they've all had this happen to them.  I checked my accessibility settings, and Zoom was already off.  So what is causing this problem for so many people, and what can we do to prevent it?  Please help.

  • I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. I want to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere? Also is it worth just buying another external HD to back up

    I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. However, it is not backed up, so I need a solution to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere for cloud products? Will it be cheaper/easier just to buy another external HD to back up my existing external HD? Thanks

    I don't know if this is me adding files to iTunes when the external wasn't connected
    it is.
    is it OK to just keep deleting that library on the Air?
    i wouldn't - at least not until i
    mount the external
    point iTunes media folder location back to the external via preferences > advanced
    consolidate my library via file > library > organize library
    The ntfs hasn't seem to be causing any problems, but I've always wanted to know.
    in order for your Mac to write to NTFS drives, it needs some help by installing e.g. the NTFS 3G driver. apparently that or something similar is installed on your Mac already. preferably, it would be formatted for Mac but then windows machines would need to have e.g. MacDrive installed to recognize the drive.

  • How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel

    How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel?

    See this thread here
    Display number of emails by sender

  • Is there a way to change the order of the listing on Hub for Z 10?

    Is there a way to move the order the listing is set for the Hub on Z 10?

    I've messed around with my Hub settings for a while and I don't see any way of changing the order so I'm pretty sure it can't be done.  That's just a guess but I make pretty good guesses. 
    Cheers. 
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

Maybe you are looking for

  • Evaluated Receipt Settelement - Automatic PO creation in GR

    Dear Experts, Please answer my querry - here in my scenario, Purchase order is created automatically, at the time of Goods receipt Posting. Now i want post invoices automatically (ERS) with the reference of Purchase Order/Goods receipt. settings made

  • Since i downloaded Ios 6.0 every app crashes, even the original apps

    Hi there, I have an Iphone 4, and since the update of IOS 6.0 i'm having problems with ALL my apps, even the apps from Apple. Cause there crashing after i started them, most of the time they are up for like 3 min. And after that, black screen back to

  • IDisk on the iPad

    Anyone know how iDisk is implemented on the iPad? I was hoping I could have Pages and Numbers docs saved on my iDisk that I could open up, edit and save on my iPad which would then sync back via MobileMe to my other macs. Is this possible or can I on

  • Brightness buttons not working and glitchy with simple commands

    I bought a macbook pro 6 months ago. The computer is in mint condition, but has been glitchy, especially with signing in or the simple command of putting in a login password. In order to login you must shut down the computer because the screen is fro

  • TS1702 my notes have disappeared, how do I get them back?

    I just went to go into my notes, and they have disappeared?  How do I get these back...I had a lot of important things in there!