Thread behaves wierdly.. takes more time for less code...

Hi everyone,
I am stuck into this probel very badly..i have never seen such a problem before..Thread bottleneck somewhere is the issue i guess,,, plz have a look at the code patiently.. and do reply.. u guys are my last hope on this thing..Thank YOU...
The Bank method is called by another method which runs 50 threads , so at a time 50 threads could enter this method to record Debit...
class BankHelper {
// Some code of bank.. not relevant to my problem public Bank() {
long time = System.nanoTime();
abc.recordDebit(); // want to measure how much time this method takes
abc.recordTimeForDebit(System.nanoTime() - time); // accumulating the total time the above method takes to calculate
class abc {
// Some code of bank.. not relevant to my problem
public synchronized void recordDebit(){
debit++;
} // I had put timers aound the ++ and it took not more than 700 to 900 nanoseconds
public synchronized void recordTimeForDebit(long time){
record += time;
Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
}Answer:
Record time is 9014 millis for 5000 increments or 5000 calls to recordDebit()
One can see in the answer that its a huge number when one is expecting it to be somewhere around:
EXPECTED ANSWER:
5000 * 800 nanos( it takes 800 nanos for very increment) = 4000000 = 4 millis and its like 9014 millis
How is there such a huge difference ????????? I have bruised thorugh it for like 3 days... i have lost all my hope.. Plz help..Also look at the next code..
When i go to see in the log .. it shows me that every record took like from 2000 nanos to 6 to 7 millis i.e.7000000...
HOw is this even possibly possible ??? where did it get all this extra time from...it should not be more than some 700 to 900 nanos ..
Is there a bottleneck somewhere ????
Now part 2:
This thing has fazzed, dazzled , destroyed me.. I could not understand this and it has tossed all my concepts into the cupboard..
Same stuff: JUST HAVE A LOOK AND ENJOY AND TELL ME WHATS GOING ON...Same code.. different way of incrementing data i.e synchronization is at a different place..but results are very highly improved...
class BankHelper {
// Some code of bank.. not relevant to my problem
public Bank() {
long time = System.nanoTime();
abc.recordDebit(); // want to measure how much time this method takes
abc.recordTimeForDebit(System.nanoTime() - time); // accumulating the total time the above method takes to calculate
}The Bank method is called by another method which runs 50 threads , so at a time 50 threads could enter this method to record Debit...
class abc {
// Some code of bank.. not relevant to my problem
public void recordDebit(){
someotherclass.increment();
} // this is not synchronized nowwwwwwww
// I have put timers here too and it took like 1500 to 2500 nanos
public synchronized void recordTimeForDebit(long time){
record += time;
Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
class someotherclass{
// Not relevant code
public void increment(){
someotherclass1.increment1();
class someotherclass1{
// Not relevant code
public void increment1(){
someotherclass2.increment2();
class someotherclass2{
// Not relevant code
public synchronized void increment2(){
someotherclass3.increment3();
} //now its synchronized
class someotherclass3{
// Not relevat code
public synchronized void increment3(){
debit++;
} //now its synchronized
}ANSWER: Record is 135 millis for 5000 increments or 5000 calls to recordDebit()
Expected time was : 5000 * 2500 = 125000000 = 125 millis (WOW .. AS EXPECTED)
Please don't ask me why this code has been written this way..i know it goes and increment and does the same thing...but somehow when i measured it..
overall time or the accumulated time for both codes varied like in huge numbers...even though latter code is actually a superset of previous code..
HOW IS THERE SUCH A HUGE DIFFERENCE BETWEEN THE NUMBERS ???
COULD BE BECAUSE OF THE POINT OF SYNCHRONIZATION ???
Thank you..for going through all this..

Triple post - http://forums.sun.com/thread.jspa?threadID=5334258&messageID=10438241#10438241

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

  • Query using progressive relaxation take more time for execution

    HI Gurus,
    I am creating a query using context index and progressive relaxation
    I had started using progressive relaxation after getting inputs from forum {thread:id=2333942} . Using progressive relaxation takes more than 7 seconds for every query. Is there any way we can improve the performance of the query?
    create table test_sh4 (text1 clob,text2 clob,text3 clob);
    begin
       ctx_ddl.create_preference ('nd_mcd', 'multi_column_datastore');
       ctx_ddl.set_attribute
          ('nd_mcd',
           'columns',
           'replace (text1, '' '', '''') nd1,
            text1 text1,
            replace (text2, '' '', '''') nd2,
            text2 text2');
       ctx_ddl.create_preference ('test_lex1', 'basic_lexer');
       ctx_ddl.set_attribute ('test_lex1', 'whitespace', '/\|-_+');
       ctx_ddl.create_section_group ('test_sg', 'basic_section_group');
       ctx_ddl.add_field_section ('test_sg', 'text1', 'text1', true);
       ctx_ddl.add_field_section ('test_sg', 'nd1', 'nd1', true);
       ctx_ddl.add_field_section ('test_sg', 'text2', 'text2', true);
       ctx_ddl.add_field_section ('test_sg', 'nd2', 'nd2', true);
    end;
    create index IX_test_sh4 on test_sh4 (text3)   indextype is ctxsys.context   parameters    ('datastore     nd_mcd   lexer test_lex1 section group     test_sg') ;
    alter index IX_test_sh4 REBUILD PARAMETERS ('REPLACE SYNC (ON COMMIT)') ;-- sync index on every commit.
    SELECT SCORE(1) score,t.* FROM test_sh4 t WHERE CONTAINS (text3,  '
    <query>
    <textquery>
    <progression>
    <seq>{GIFT GRILL STAPLES CARD} within text1</seq>
    <seq>{GIFTGRILLSTAPLESCARD} within nd1</seq>
    <seq>{GIFT GRILL STAPLES CARD} within text2</seq>
    <seq>{GIFTGRILLSTAPLESCARD} within nd2</seq>
    <seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text1</seq>
    <seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text2</seq>
    <seq>((%GIFT% and %GRILL% and %STAPLES%) or (%GRILL% and %STAPLES% and %CARD%) or (%GIFT% and %STAPLES% and %CARD%) or (%GIFT% and %GRILL% and %CARD%)) within text1</seq>
    <seq>((%GIFT% and %GRILL% and %STAPLES%) or (%GRILL% and %STAPLES% and %CARD%) or (%GIFT% and %STAPLES% and %CARD%) or (%GIFT% and %GRILL% and %CARD%)) within text2</seq>
    <seq>((%STAPLES% and %CARD%) or (%GIFT% and %GRILL%) or (%GRILL% and %CARD%) or (%GIFT% and %CARD%) or (%GIFT% and %STAPLES%) or (%GRILL% and %STAPLES%)) within text1</seq>
    <seq>((%STAPLES% and %CARD%) or (%GIFT% and %GRILL%) or (%GRILL% and %CARD%) or (%GIFT% and %CARD%) or (%GIFT% and %STAPLES%) or (%GRILL% and %STAPLES%)) within text2</seq>
    <seq>((%GIFT% , %GRILL% , %STAPLES% , %CARD%)) within text1</seq>
    <seq>((%GIFT% , %GRILL% , %STAPLES% , %CARD%)) within text2</seq>
    <seq>((!GIFT and !GRILL and !STAPLES and !CARD)) within text1</seq>
    <seq>((!GIFT and !GRILL and !STAPLES and !CARD)) within text2</seq>
    <seq>((!GIFT and !GRILL and !STAPLES) or (!GRILL and !STAPLES and !CARD) or (!GIFT and !STAPLES and !CARD) or (!GIFT and !GRILL and !CARD)) within text1</seq>
    <seq>((!GIFT and !GRILL and !STAPLES) or (!GRILL and !STAPLES and !CARD) or (!GIFT and !STAPLES and !CARD) or (!GIFT and !GRILL and !CARD)) within text2</seq>
    <seq>((!STAPLES and !CARD) or (!GIFT and !GRILL) or (!GRILL and !CARD) or (!GIFT and !CARD) or (!GIFT and !STAPLES) or (!GRILL and !STAPLES)) within text1</seq>
    <seq>((!STAPLES and !CARD) or (!GIFT and !GRILL) or (!GRILL and !CARD) or (!GIFT and !CARD) or (!GIFT and !STAPLES) or (!GRILL and !STAPLES)) within text2</seq>
    <seq>((!GIFT , !GRILL , !STAPLES , !CARD)) within text1</seq>
    <seq>((!GIFT , !GRILL , !STAPLES , !CARD)) within text2</seq>
    <seq>((?GIFT and ?GRILL and ?STAPLES and ?CARD)) within text1</seq>
    <seq>((?GIFT and ?GRILL and ?STAPLES and ?CARD)) within text2</seq>
    <seq>((?GIFT and ?GRILL and ?STAPLES) or (?GRILL and ?STAPLES and ?CARD) or (?GIFT and ?STAPLES and ?CARD) or (?GIFT and ?GRILL and ?CARD)) within text1</seq>
    <seq>((?GIFT and ?GRILL and ?STAPLES) or (?GRILL and ?STAPLES and ?CARD) or (?GIFT and ?STAPLES and ?CARD) or (?GIFT and ?GRILL and ?CARD)) within text2</seq>
    <seq>((?STAPLES and ?CARD) or (?GIFT and ?GRILL) or (?GRILL and ?CARD) or (?GIFT and ?CARD) or (?GIFT and ?STAPLES) or (?GRILL and ?STAPLES)) within text1</seq>
    <seq>((?STAPLES and ?CARD) or (?GIFT and ?GRILL) or (?GRILL and ?CARD) or (?GIFT and ?CARD) or (?GIFT and ?STAPLES) or (?GRILL and ?STAPLES)) within text2</seq>
    <seq>((?GIFT , ?GRILL , ?STAPLES , ?CARD)) within text1</seq>
    <seq>((?GIFT , ?GRILL , ?STAPLES , ?CARD)) within text2</seq>
    </progression>
    </textquery>
    <score datatype="FLOAT" algorithm="default"/>
    </query>',1) >0 ORDER BY score(1) DESC

    Progressive relaxation works best when you're only selecting a limited number of rows. If you fetch ALL the rows which satisfy the query, then all the steps in the relaxation will have to run regardless.
    If you fetch - say - the first 10 results, then if the first step of the relaxation provides 10 results then there is no need to execute the next step (in fact, due to internal buffering, that won't be exactly true but it's conceptually correct).
    The simplest way to do this is reword the query as
    SELECT * FROM (
    ( SELECT SCORE(1) score,t.* FROM test_sh4 t WHERE CONTAINS (text3, '
    <query>
    <textquery>
    </textquery>
    <score datatype="FLOAT" algorithm="default"/>
    </query>',1) >0 ORDER BY score(1) DESC
    WHERE ROWNUM <= 10
    You've discovered that leading wild cards don't work too well unless you use SUBSTRING_INDEX. I would encourage you to avoid them altogether if possible, or push them down much lower in the progressive relaxation. Usually, GIFT% is a useful expression (matches GIFTS, GIFTED, etc), %GIFT% is generally no more effective.
    There are a lot of steps in your progressive relaxation. It you wanted to reduce the number of steps, you could change:
    <seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text1</seq>
    <seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text2</seq>
    to
    <seq>((%GIFT% and %GRILL% and %STAPLES% and %CARD%)*2) within text1 ACCUM ((%GIFT% and %GRILL% and %STAPLES% and %CARD%)) within text2</seq>
    I don't know if this would have any performance benefits - but it's worth trying it to see.

  • How do we tune a query that takes more time for the first time?

    Hi,
    First time it takes 20 secs and subsequent times 2 secs.
    Let me know if you need more info
    Thanks

    Following are the parameters set at the DB level.
    .__db_cache_size=2214592512
    .__java_pool_size=16777216
    .__large_pool_size=16777216
    .__shared_pool_size=1543503872
    .__streams_pool_size=33554432
    *._optimizer_cost_based_transformation='off'
    *._smu_debug_mode=4
    *.compatible='10.2.0.1.0'
    *.cursor_sharing='SIMILAR'
    *.db_block_size=8192
    *.db_domain=''
    *.db_file_multiblock_read_count=16
    *.job_queue_processes=10
    *.open_cursors=5000
    *.optimizer_mode='ALL_ROWS'
    *.pga_aggregate_target=1277165568
    *.processes=250
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sessions=1000
    *.sga_target=3833593856
    *.undo_management='AUTO'
    *.undo_tablespace='UBPTAB_UNDO'
    Execution Plan
    Plan hash value: 2107556093
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 45157 | 29M| | 9094 (1)| 00:01
    :50 |
    | 1 | SORT ORDER BY | | 45157 | 29M| 78M| 9094 (1)| 00:01
    :50 |
    |* 2 | TABLE ACCESS FULL| <tname>| 45157 | 29M| | 2564 (2)| 00:00
    :31 |
    Following are result from dba_tab_statistics.
    NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_CACHE_HIT_RATIO AVG_ROW_LEN
    112704 11520 768 685
    AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS
    0 0
    Follwing was the time it has taken to generate the explain plan report after issuing the below command.
    set autotrace traceonly
    Elapsed: 00:00:15.49
    Following is the statistics
    Statistics
    0 recursive calls
    0 db block gets
    11380 consistent gets
    0 physical reads
    0 redo size
    8823636 bytes sent via SQL*Net to client
    37731 bytes received via SQL*Net from client
    3019 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    45267 rows processed
    Pl let us know how to tune the same.
    Thank you all for the help

  • How the implementation differs between BW and BI , Is BI takes more time fo

    Hi All,
    I would like to know difference between implemenation and time lines for MM as mentioned below.
    How the implementation differs between BW and BI , Is BI takes more time for implementing MM module  than on BW?
    Thanks in advanced. (Full points will be awarded)
    With Regards,
    PCR

    Hi Timo,
    Thanks for response!
    But as i read from the following url: http://docs.oracle.com/cd/E15051_01/apirefs.1111/e10653/oracle/jbo/ViewObject.html, the setQueryTimeOut(int timeOutMills), the timeOut is mentioned in milliseconds. Please correct me if I am wrong.
    and i have overriden the executeQuery() method in the View Object Impl class as shown below:
    public void executeQuery() {
    Map sessionScope = ADFContext.getCurrent().getSessionScope();
    sessionScope.put("MyQuery", this);
    try {
    super.executeQuery();
    } finally {
    sessionScope.remove("MyQuery");
    throw new JboException("Query Taking too long to respond");
    and in the JAVA class i am calling the above method like this:
    monitor.setQueryTimeOut(6);
    monitor.executeQuery();
    But the issue is:
    1. The above exception message is getting carried forward to other pages as well. I mean somewhere in the session/ADFContext this message is being saved and error comes up/pops up when i click on other tabs of the page. How do i clear this?
    2. The above exception message is coming for the first time but when i click the 'Submit' button second time, i am getting the results and also the message that 'Query is taking too long to respond'. This should not be the case, everytime it should show the same message as the timeout limit is less and the query should end without fetching the results.
    Kindly let me know how to resolve the above issues, any pointers will be helpful.
    Thanks in advance.
    Edited by: user9223904 on Nov 3, 2012 4:42 AM

  • Publishing EJBs takes more time in Oracle Weblogic 10.3 workshop

    Hi,
    We recently migrated from Weblogic 9.2 to Oracle Weblogic 10.3 workshop.
    I have a ejb project which has more than 30 ejb's(both entity and session ejbs).
    The problem is: whenever I modify the code inside a method and save, it builds the project automatically. After that when I try to publish the module, it takes around 5 - 10 minutes for publishing.
    Points to note are : The ejb I am modifying has reference to other (10 - 20) ejbs. Hence it takes more time for even for single ejb change.
    however, when i modify an ejb which has no reference to ejb, takes less time to publish.
    My question is : is there a way to reduce the publishing time in this scenario.
    Thanks in advance!

    There is a special forum for Workshop issues:
    Workshop
    Try there.

  • Threads behaving wierdly..Work of 5 months going for a toss.. plz help...?

    Hi everyone,
    I am stuck into this probel very badly..i have never seen such a problem before..Thread bottleneck somewhere is the issue i guess,,, plz have a look at the code patiently.. and do reply.. u guys are my last hope on this thing..Thank YOU...
    The Bank method is called by another method which runs 50 threads , so
    at a time 50 threads could enter this method to record Debit... class BankHelper {
    // Some code of bank.. not relevant to my problem
         public Bank() {
                    long time = System.nanoTime();
                    abc.recordDebit();_ *// want to measure how much time this method takes*_
                    abc.recordTimeForDebit(System.nanoTime() - time); *_// accumulating the total time the above method takes to calculate_*
        class abc {
    // Some code of bank.. not relevant to my problem
        public synchronized void recordDebit(){
            debit++;      
        } _*// I had put timers aound the ++ and it took not more than 700 to 900 nanoseconds*_
        public synchronized void recordTimeForDebit(long time){
            record += time;
            Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
    Answer:_
    Record time is 9014 millis for 5000 increments or 5000 calls to recordDebit()_
    One can see in the answer that its a huge number when one is expecting it to be somewhere around:
    EXPECTED ANSWER:
    *5000 * 800 nanos( it takes 800 nanos for very increment) = 4000000 = 4 millis and its like 9014 millis*
    How is there such a huge difference ????????? I have bruised thorugh it for like 3 days... i have lost all my hope.. Plz help..Also look at the next code..
    When i go to see in the log .. it shows me that every record took like from 2000 nanos to 6 to 7 millis i.e.7000000...
    HOw is this even possibly possible ??? where did it get all this extra time from...it should not be more than some 700 to 900 nanos ..
    Is there a bottleneck somewhere ????
    Now part 2:
    This thing has fazzed, dazzled , destroyed me.. I could not understand this and it has tossed all my concepts into the cupboard..
    Same stuff: JUST HAVE A LOOK AND ENJOY AND TELL ME WHATS GOING ON...Same code.. different way of incrementing data i.e synchronization is at a different place..but results are very highly improved...
        class BankHelper {
    // Some code of bank.. not relevant to my problem
         public Bank() {
                    long time = System.nanoTime();
                    abc.recordDebit(); // want to measure how much time this method takes
                    abc.recordTimeForDebit(System.nanoTime() - time); // accumulating the total time the above method takes to calculate
    }The Bank method is called by another method which runs 50 threads , so at a time 50 threads could enter this method to record Debit...
        class abc {
    // Some code of bank.. not relevant to my problem
        public void recordDebit(){
            someotherclass.increment();      
        } // this is not synchronized nowwwwwwww
    // I have put timers here too and it took like 1500 to 2500 nanos
        public synchronized void recordTimeForDebit(long time){
            record += time;
            Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
    class someotherclass{
    // Not relevant code
        public void increment(){
            someotherclass1.increment1();      
    class someotherclass1{
    // Not relevant code
        public void increment1(){
            someotherclass2.increment2();      
    class someotherclass2{
    // Not relevant code
        public synchronized void increment2(){
            someotherclass3.increment3();      
        } //now its synchronized
    class someotherclass3{
    // Not relevat code
        public synchronized void increment3(){
            debit++;      
        } //now its synchronized
    ANSWER: Record is 135 millis for 5000 increments or 5000 calls to recordDebit()_
    Expected time was : 5000 2500 = 125000000 = 125 millis (WOW .. AS EXPECTED)*
    Please don't ask me why this code has been written this way..i know it goes and increment and does the same thing...but somehow when i measured it..
    overall time or the accumulated time for both codes varied like in huge numbers...even though latter code is actually a superset of previous code..
    HOW IS THERE SUCH A HUGE DIFFERENCE BETWEEN THE NUMBERS ???
    COULD BE BECAUSE OF THE POINT OF SYNCHRONIZATION ???
    Thank you..for going through all this..

    Answered on JavaRanch. By synchronizing both the increment and the recording methods, you can only perform one of those functions at a time.Thanking you Steve, I shall read and inwardly digest.
    My (humble) advise is:
    1. WTF are you doing trying to measure the time taken to execute a [unirary operation|http://en.wikipedia.org/wiki/Unary_operation] (you putz!) which is just like so freeken small (on a 2Ghz CPU) that even a gazzillion invocations might take less time than it took you get your duds off in order to earn your reputation as a putz!
    2. FFS, Don't write profiling code in your app... just download one. VisualVM is way cool!
    3. As you would know, if you had bothered to actually RTFM at any stage in your (bugging;-) career... synchronized methods are slow(er) because of the farckin time taken to acquire and release the lock... as well as the inherent inefficiency of bottlenecking a whole method, as apposed to just the critical statements... which in the case of a simple incrementor is just about no near new never mind... so no never mind... but still the fact remains... you've turned an atomic operation (google it yourself) into a bottleneck... and then you're standing there whining about bottlenecks. Doh!
    4. Seriously dude, read the effin manual.
    Edited by: corlettk on 27/09/2008 14:19

  • A block of code takes more time in JRE 6_20 but less in the previous versio

    while (entries.hasMoreElements()) {
    ZipEntry zipEntry = (ZipEntry) entries.nextElement();
    is = zipFile.getInputStream(zipEntry);
    File file = new File(unzipDir, zipEntry.getName());
    if (is.available() == 0) {
    file.mkdir();
    is.close();
    } else {
    file.createNewFile();
    fos = new FileOutputStream(file);
    CommonUtils.connectIO(is, fos, -1, true);
    }

    Sorry a type,. The above code takes more time when I run withJDK 6_20. But its less time if the previous version is used. Cannot figure whats wrong. Here is the full method.
    * Unzips the specified file into the specified directory. The optional file names list allows the caller
    * to specify the actual files that get unzipped.
    * @param srcFile the file to unzip
    * @param unzipDir the directory where the unzipped files will be put
    * @param fileNames the optional list of name strings for the zip entries to unzip or <code>null</code> to unzip
    * all entries
    * @throws NullPointerException if either the source file or the unzip directory is <code>null</code>
    * @throws javax.faces.FacesException if the
    public static void unzipFile(File srcFile, File unzipDir, List fileNames) {
    if (srcFile == null) {
    throw new NullPointerException("The zip file argument is null");
    if (unzipDir == null) {
    throw new NullPointerException("The unzip directory argument is null");
    ZipFile zipFile = null;
    InputStream is = null;
    FileOutputStream fos = null;
    try {
    zipFile = new ZipFile(srcFile);
    Enumeration entries = null;
    if (fileNames != null) {
    // Use a vector only so we can abstract away the zip entries enumeration...
    Vector v = new Vector();
    Iterator it = fileNames.iterator();
    while (it.hasNext()) {
    String name = (String) it.next();
    v.add(new ZipEntry(name));
    entries = v.elements();
    } else {
    entries = zipFile.entries();
    while (entries.hasMoreElements()) {
    ZipEntry zipEntry = (ZipEntry) entries.nextElement();
    is = zipFile.getInputStream(zipEntry);
    File file = new File(unzipDir, zipEntry.getName());
    if (is.available() == 0) {
    file.mkdir();
    is.close();
    } else {
    file.createNewFile();
    fos = new FileOutputStream(file);
    CommonUtils.connectIO(is, fos, -1, true);
    catch (IOException e) {
    throw new FacesException("Problem unzipping file " + srcFile.getAbsolutePath(), e);
    finally {
    try {
    if (is != null) {
    is.close();
    if (fos != null) {
    fos.close();
    if (zipFile != null) {
    zipFile.close();
    catch (IOException e) {
    throw new FacesException("Problem closing resources when unzipping file " + srcFile.getAbsolutePath(), e);
    }

  • Save for web - system take more time

    Hi, We used adobe photo shop cloud one of our blog for optimized images. We use "save for web" option in photoshop. But its will take more time. What is the reason. How to solve this issue.

    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Multithreaded File Copy takes more time 1.5 times than single thread.

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.nio.channels.FileChannel;
    public class TestMulti implements Runnable {
         public static Thread Th1;
         public static Thread Th2;
         String str = null;
         static int seqNumber = 1000000000;
         public static void main(String args[]) {
              Th1 = new Thread(new TestMulti("1_1"));
              Th2 = new Thread(new TestMulti("1_2"));
              Th1.start();
              Th2.start();
              try {
                   Th1.join();
                   Th2.join();
              } catch (Exception e) {
                   e.printStackTrace();
         public TestMulti(String str) {
              this.str = str;
         public void run() {
              File f = new File("C:/Songs2/" + str);
              File files[] = f.listFiles();
              String fileName = "";
              String seqName = "";
              String seq = "";
              int sequenceNo = 0;
              try {
                   for (int j = 0; j < files.length; j++) {
                        File musicFiles[] = files[j].listFiles();
                        for (int k = 0; k < musicFiles.length; k++) {
                             seq = "18072006";
                             seqName = seq + seqNumber;
                             sequenceNo = 10000 + seqNumber % 100;
                             seqNumber = seqNumber + 1;
                             fileName = musicFiles[k].getName();
                             String fileExt = fileName.substring(fileName.length() - 3,fileName.length());
                             String targetFile = "C:/Songs1/" + sequenceNo;
                             File fi = new File(targetFile);
                             if (!fi.exists()) { fi.mkdir(); }
                             targetFile = "C:/Songs1/" + sequenceNo + "/" + seqName+ "." + fileExt;
                             FileInputStream fin = new FileInputStream(musicFiles[k]);
                             FileChannel fcin = fin.getChannel();
                             FileOutputStream fout = new FileOutputStream(targetFile);
                             FileChannel fcout = fout.getChannel();
                             fcin.transferTo(0, fcin.size(), fcout);
                             fout.flush();
                             fcout.close();
                             fcin.close();
                             fout.close();
                             fin.close();
              } catch (Exception e) {
                   e.printStackTrace();
    Multithreaded File Copy takes more time 1.5 times than single thread.
    Is there any issue with this code. Please help me.

    If all of your threads are doing CPU-intensive work, or all are doing I/O to the same interface (for example, writing to the same physical disk), then multithreading would not be expected to help you.
    Multithreading does not magically make your CPU able to do more work per unit time than it could otherwise.
    Multithreading does not magically make your network interface or disk controller able to pump more bytes through than it could otherwise.
    Where multithreading helps (some or all of this has already been mentioned):
    * When you have multiple, independent CPU-bound tasks AND multiple CPUs available on which to execute them.
    * When you have tasks that involve a mix of CPU-bound and I/O-bound work. The CPU-bound stuff can crank while the I/O-bound stuff waits for bytes to be written or read, thus making use of what would otherwise be CPU "dead time."
    What you're doing does not fit either of those scenarios. Copying a file is pure I/O. If the source and destination file are on the same phsyical disk or controller, adding threads only adds overhead with no real possibility to do more work per unit time.
    If your source and destination are on different disks or controllers, then it's possible that you could get some benefit from multithreading. While one thread is waiting for bytes to be written to the target disk, the other thread can be reading from the source disk.

  • Count (*)  for select stmt take more time than  execute a that sql stmt

    HI
    count (*) for select stmt take more time than execute a that sql stmt
    executing particular select stmt take 2.47 mins but select stmt is using the /*+parallel*/ (sql optimer) in that sql  command for faster execute .
    but if i tried to find out total number of rows in that query it takes more time ..
    almost 2.30 hrs still running to find count(col)
    please help me to get count of row faster.
    thanks in advance...

    797525 wrote:
    HI
    count (*) for select stmt take more time than execute a that sql stmt
    executing particular select stmt take 2.47 mins but select stmt is using the /*+parallel*/ (sql optimer) in that sql  command for faster execute .
    but if i tried to find out total number of rows in that query it takes more time ..
    almost 2.30 hrs still running to find count(col)
    please help me to get count of row faster.
    thanks in advance...That may be because your client is displaying only the first few records when you are running the "SELECT *". But when you run "COUNT(*)", the whole records has to be counted.
    As already mentined please read teh FAQ to post tuning questions.

  • ADF application taking more time for first time and less from second time

    Hi Experts,
    We are using ADF 11.1.1.2.
    Our application contains 5 jsp pages, 10 - 12 taskflows, and 50 jsff pages.
    For the first time in the day if we use the application it is taking more than 60 sec on some actions.
    And from the next time onwords it is taking 5 to 6 sec.
    Same thing is happening daily.
    Can any one tell me why this application is taking more time for first time and less time from second time.
    Regards
    Gayaz

    Hi,
    If you don't restart you WLS every day, then you should read about Tuning Application Module Pools and Connection Pools
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0301
    And pay attention to the parameter: Maximum Available Size, Minimum Available Size
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0314
    And adjust them to suit your needs.

  • MacBook Pro takes much time for Shutdown (More than 1 min.)

    I have a MacBook Pro, and some weeks ago, it takes much time for shutdown.
    I've tried to install the 10.5.2 update, but nothing solves.
    My mac takes for shutdown 1 min & 30 seconds every time. I don't understand. Why?
    What can I do? I tried to repair permissions and reset the PMU, but the problem still there.
    Help me! Please!
    Thanks
    Sorry, but I'm spanish and it's possible that I've made more mistakes writing in English.

    Thanks. I tried to dissable an EyeTv option, then EyeConnect don't appears in the Activity Monitor. This is the result:
    Now, my MacBook Pro takes only 35 seconds for shutdown. I think is better than yesterdey, but is more than the 5 seconds that you described in the last post. Is 35 seconds a good time? In this 35 seconds, I only can see the background image, without icons and without the finder menu bar. After 35 seconds, Mac is off.
    How can I disable iDisk sync? I have a free mac Account, but is expired and then I can't use iDisk, only the name in iChat. But, is iDisk enabled?

  • When i put my Mac for sleep it takes more time than normal ( 20 secs). Sometimes, coming back from sleep the system is not responding (freeze).

    When i put my Mac for sleep it takes more time than normal (>20 secs). Sometimes, coming back from sleep the system is not responding (freeze).

    Perform SMC and NVRAM resets:
    http://support.apple.com/en-us/HT201295
    http://support.apple.com/en-us/HT204063
    The try a safe boot:
    http://support.apple.com/en-us/HT201262
    Any change?
    Ciao.

Maybe you are looking for

  • Unable to replicate the Vendor Master Records

    Hi I am using the transaction BBPGETVD to transfer the Vendor Master Records from R/3 ro SRM...but could not able to transfer it as I am getting an error "Organizational unit - does not exist; check entries", even through I have created Organisation

  • Problem updating 5800 XM to firmware v30

    I tried updating my 5800 XM to firmware 30 via OTA update. The update downloads and I accept the install. The phone then reboots showing a update in progress or something like that. It then reboots again and starts up with the following message: "Pho

  • Video asset in button cropped - Unable to match aspect ratios

    I am using the Apple "Light Frame" button and linking an mpeg2 video asset to that button to look like active, mini 16 X 9 plasma televisions for my scene selection menu. Unfortunately it insists on cropping out much of my mp2 video image. Following

  • Error Code 1418?

    I know I'm new here, but I don't care right now. I need somebody to tell me what Error Code 1418 is. I'm using a fifth-generation iPod Video, 30 gig. After an impact, which involved my iPod falling off my desk, when I updated it, the update failed, a

  • How to get the distinct values in Attribute View?

    Hi, While doing the data preview of attribute view its showing duplicate records. Can i restrict all these duplicate in attribute view and get only distinct values? Thanks in advance.