Time for creating big arrays

Hi,
My program needed to create several arrays with big size and I found a interesting phenomenon:
int capacityI=13000000;
time1=System.currentTimeMillis();
int[] v1=new int[13000000];
time2=System.currentTimeMillis();
int[] v2=new int[13000000];
long time3=System.currentTimeMillis();
int[] v3=new int[13000000];
long time4=System.currentTimeMillis();
int[] v4=new int[13000000];
long time5=System.currentTimeMillis();
int[] v5=new int[13000000];
long time6=System.currentTimeMillis();
System.out.println(time2-time1);
System.out.println(time3-time2);
System.out.println(time4-time3);
System.out.println(time5-time4);
System.out.println(time6-time5);And following is an output of the program:
15
16
16
5625
16
it took much more time to create the fourth array and I could not find the reason. My program is a big program, It did many things before the execution of the above code. Was it related to the garbage collector? I meant the java system ran the garbage collection program before the creation the the fourth array. Was I right?
I want to prevent this problem, i.e., decrese the time for the creation of arrays. Is there any way?
Thanks.

Note that your snippet of test code doe snot require the 5 arrays to be in memory at the same time and is hence not representing your later stated requirement to have them all available.
Your locally created v1 array is not referenced anymore after creation and therefore eligible for garbage collection, be aware of that. Setting good initial and maximum heap size values as suggested by others is of importance here.

Similar Messages

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document

    Hi Experts,
    I m using 'BAPI_GOODSMVT_CREATE' in my custom report, it takes more time for creating Material documents.
    Please let me know if there is any option to overcome this issue.
    Thanks in advance
    Regards,
    Leo

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document for the 1st time

    Hi Experts,
    I am doing goods movement using BAPI_GOODSMVT_CREATE in my custom code.
    Then there is some functional configuration such that, material documents and TR and TO are getting created.
    Now I need to get TO and TR numbers from LTAK table passing material documnt number and year, which I got from above used BAPI.
    The problem I am facing is very strange.
    Only for the 1st time, I am not finding TR and TO values in LTAK table. And subsequent runs I get entries in LTAK in there is a wait time of 5 seconds after bapi call.
    I have found 'BAPI_GOODSMVT_CREATE' takes more time for creating material document with similar issue, but no solution or explanation.
    Note 838036 says something similar, but it seems obsolete.
    Kindly share your expertise and opinions.
    Thanks,
    Anil

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • To know the actual date & time for created versions in cprojects

    HI ABAPers,
    Am working on cproject version 3.1,  wanted to know where the  exact date & time  is getting captured when a version i.e
    con H & base  versions is created in cprojects ( collaboration projects ).
        Already i have checked in  dpr_project table where versions are getting stored with the same project created date & time. But not with the actual date & time when the versions were created. 
    is there any BAPI or table where we can know the actual date & time of the created versions.
    Thank you!!!
    Abdul

    Hi,
    According to your post, my understanding is that you want to change date format for ‘Created’ field in the getVersions web service.
    Per my knowledge, you can get the date format for ‘Created’ field as “MM/dd/yyyy HH:mm a”.
    For more information, you can refer to:
    Versions.GetVersions Method (Versions)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Long time for Create miniatures in Adobe Elements 10 Organizer

    Hello
    I have installed the PS Elements 10 as trial and have use also Organizer.
    I see all pictures in the window and see the folders and photos in the view path.
    But the organizer don't run good.
    I see in the status underfood the info.
    <Create miniatures>
    Is that a normal behavior ?
    Can I see how long this process need ?
    Please give feedback.
    Jochen

      It will depend on the size of your catalog but can take several minutes.
    Make sure you are not moving or deleting photos on the OS e.g. using Explorer or Finder. Make all changes within the Organizer and then you won’t break the photo links to the files on your hard drive.
     

  • Best way to create an array of bound values (to the resourceManager for example)

    What's the best practice for creating an array (array collection) where each element is bound to another value?
    An example would be an array of error strings that are used by an application.  Each string needs to change as the resource manager changes.
    Passing a list of strings to a list control is another example.  These should get localized as well.

    hobby1 wrote:
    Crossrulz, I was planning on handling it like this: 
    I have a total of 17 element I need to build an array from.  Each case would include another element to be written to the array.  Is this the correct way to handle this?
    Thats one way to do it.  Not nearly as efficient as using the Build Array, but it will work.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Creating dynamic array

    Can anybody tell me how to create a dynamic array in Java??I dont want to fix size of array,it should take any number of values at runtime.Please tell me the syntax of using dynamic arrays.

    Hi,
    For creating an array of similar data elements, use
    ArrayList., but for storing elements which are in the
    form of object then use Vector...
    Best of Luck..
    R SWrong... the main different between ArrayList and Vector is that Vector was sychronized and ArrayList are not.

  • Creating an array in a 'for' loop (resetting loop count)

    Hi,
    I am trying to integrate an acceleration signal coming from a CRIO analogue input to obtain the speed and then further integrate to get the displacement of a vibration system.
    I understand that in order to perform the integration, an array has to be fed in. My problem is that I could not buffer the signal in a buffer block as I couldn't find any buffer blocks. so I decided to create my an array of data using a 'for' loop. The 'for' loop nests inside a timed loop. The problem that I got stuck at is how to reset the 'for' loop in order to refill the buffer again at every iteration of the outer timed loop.
    I have attached the code if that helps. Note that I am using labview 2013.
    I would be gratefull if someone who had encountered a similar issue before can help me.
    Regards
    Ali
    Solved!
    Go to Solution.
    Attachments:
    acc_test.vi ‏42 KB

    Dear Altenbach,
    Many thanks for your reply.
    I need to make it clear that I have not had enough hands-on with labview, I have only used it for sometime in the past and now I have to in order to perform some active damping on a 50Hz running machine. I must stress the fact that what i find more intuitive to do in a different programming language (matlab or C) is not as straightforward in labview. so please bear with me if my code has basic mistakes .
    All what i am trying to do is obtain the speed and position from an acclerometer signal. unfortunately i dont have a position sensor so i have to measure acceleration then perform time integrations in order to obtain the speed and position respectively. I am using a compact Rio (later in FPGA mode) to take physical measurements of acceleration from the vibratory machine and where i managed to do this bit successfully. when it came to performing the integration, i had to create an array inside my timed loop since i couldn't find a buffer block. I implemented a 'for' loop inside a timed loop in order to build the array. however i got stuck at resetting the count of the 'for' loop in order to refill the array with new values at every new iteration of the outer timed loop. unfortunately, even a sensible answer has been suggested before, i dont seem to have been capable of doing it yet. I really spent all my day trying to figure a way out but not achieved it yet, nevertheless I have learnt many many things by playing around.
    I would be gratefull if you could comment on a possible way of doing what i am trying to do.
    Kind Regards
    Ali

  • Create Adobe Form using Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    I need the step to step guide where you create the adobe form using the Design Time for Processes and Forms. Anyone have any idea?
    Edited by: Siong Chao on Jan 3, 2011 4:54 AM
    Edited by: Siong Chao on Jan 3, 2011 5:00 AM

    Hi,
    I couldn't get to your query..
    What do you mean by step by step procedure for a design time & process for forms.
    if you are a beginner and looking for basic examples to implement adobe forms there are lot of them in SDN, please search them.
    let me know if your query was a very specific one.
    Cheers,
    Sai

  • When firefox checking for updates and updates found but due to proxy restrictions it unable to download the updates then it continue trying to download that and this time it creating problem on running javascript

    When firefox checking for updates and updates found but due to proxy restrictions it unable to download the updates then it continue trying to download that and this time it creating problem on executing javascript and raising errors.

    What are the error messages you are seeing?

  • Have Operating System 10.6.8, Mail Program 4.6.  How can I prevent the next email in the que from automatically opening after I act on the previous email ? It creates big organizational problems for me. My computer changes this mode from self opening to m

    Have Operating System 10.6.8, Mail Program 4.6.
    How can I prevent the next email in the que from automatically opening after I act on the previous email ? It creates big organizational problems for me. My computer changes this mode from self opening to manually opening every few month with no ? action from me.
    Help

    Have Operating System 10.6.8, Mail Program 4.6.
    How can I prevent the next email in the que from automatically opening after I act on the previous email ? It creates big organizational problems for me. My computer changes this mode from self opening to manually opening every few month with no ? action from me.
    Help

  • Where to create index for a big partitioned table?

    Hello all.
    I can't make a decision.
    We are going to create an index for a big partitioned table (600 GB).
    Where to create it ?
    1. In the same tablespace where the table resides
    2. In a new tablespace created for this index on the same filesystem.
    Please write your suggestions. Pros and cons.
    Thank you in advance.
    Message was edited by:
    v838

    For manageability, you can create the index partition into different tablespaces.
    There won't be any performance gain segregating tables and its indexes into different tablespaces.
    Jaffar

  • I've exported a pdf document created in 2009 at least 20 times for a doc or docx version. Gibberish.

    I've exported a pdf document created in 2009 at least 20 times for a doc or docx version. Gibberish.

    Hi,
    Please open your PDF file in Adobe Reader then check the producer from File menu>Properties then let me know.I have seen the same issue with PDF file created by some producers.
    Or you can send me your PDF file so that I can look at it.
    Please use below site to share your file.
    https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg#
    Thank you.
    Hisami

  • Gather table stats takes time for big table

    Table has got millions of record and it is partitioned. when i analyze the table using the following syntax it takes more than 5 hrs and it has got one index.
    I tried with auto sample size and also by changing the estimate percentage value like 20, 50 70 etc. But the time is almost same.
    exec dbms_stats.gather_table_stats(ownname=>'SYSADM',tabname=>'TEST',granularity =>'ALL',ESTIMATE_PERCENT=>100,cascade=>TRUE);
    What i should do to reduce the analyze time for Big tables. Can anyone help me. l

    Hello,
    The behaviour of the ESTIMATE_PERCENT may change from one Release to another.
    In some Release when you specify a "too high" (>25%,...) ESTIMATE_PERCENT in fact you collect the Statistics over 100% of the rows, as in COMPUTE mode:
    Using DBMS_STATS.GATHER_TABLE_STATS With ESTIMATE_PERCENT Parameter Samples All Rows [ID 223065.1]For later Release, *10g* or *11g*, you have the possibility to use the following value:
    estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZEIn fact, you may use it even in *9.2*, but in this release it is recommended using a specific estimate value.
    More over, starting with *10.1* it's possible to Schedule the Statistics collect by using DBMS_SCHEDULE and, specify a Window so that the Job doesn't run during production hours.
    So, the answer may depends on the Oracle Release and also on the Application (SAP, Peoplesoft, ...).
    Best regards,
    Jean-Valentin

  • When I import my Sony video, which is in m2ts format, the file size is a few times larger.  This affects the volume of clips for creating the blu-ray or DVD discs.  How can I squeeze the file size without sacrificing the quality of output?

    When I import my Sony video, which is in m2ts format, the file size is a few times larger.  This affects the volume of clips for creating the blu-ray or DVD discs.  How can I squeeze the file size without sacrificing the quality of output?  Is there any other ways of achieving this?

    wongrayd wrote:
    Thanks.  I do not have the experience on burning discs from iMovie for the movie after editing (ie for video discs players).  It seems that i cannot find the relevant command in the tool bar for this purpsoe.  Would you please show me the way?
    The command is gone because iDVD has been discontinued by Apple. After Apple discontinued iDVD they removed the iDVD burning link from iMovie. I still use iDVD sometimes, only because I have an old copy.
    wongrayd wrote:
    You have mentioned about Handbrake as a converter.  What is the RF no. (under Constant Quality) meant?  It seems that the smaller the no. is, the better quality will be.  What is the optimal no.? or should we use the Average Bitrate? Again, what is the best rate?  Furthermore, which format is more suitable or the best: H264 or mpeg 2/4?
    I don't know what RF means. When I have used HandBrake, I've used presets that apply to what I want to do, so I don't know the meaning of each individual setting. However, it appears that many of them are listed in the HandBrake User's Guide that is linked from the Help menu in the program:
    https://trac.handbrake.fr/wiki/HandBrakeGuide
    wongrayd wrote:
    For iMac, except iMovie, what other software is the best for the amateur?  I have read Photoshop.  Can this support m2ts files and user friendly?
    Photoshop is not amateur-level software, and although it can edit a video, it cannot burn a DVD. Unfortunately, because I still use iMovie, I haven't tried anything else. You might want to read the reviews of various DVD-burning applications in the Mac App Store.
    And maybe another forum member will jump in and help us here!

Maybe you are looking for