Asking help for performance issues about concurrent package

One of my friends is developing a service based on resin. They use thread pool of current package in jdk1.5. The service will create a lot of threads in the thread pool. And most of the threads are waiting. What they can not make sure is how the large amount of waiting threads will affect the performance. These threads surely will occupy a lot of memory. But how will they affect the cpu?
Some documents on the Internet say that the large amount of waiting threads will largely increase the thread switching overhead. And some others say no because the scheduler will not be affected by waiting threads. I'm not sure which one is true. Would anyone like to give me some tips? It's better if you can point out any our documents about it.
Thanks!

No, it just depends on Data Structures 101.
You would have a list of ready threads, from which you would allocate one to the processor on some priority and fairness scheme, and another list of non-ready threads which you would only promote to the ready list when something happened to them that made them ready.
And among the ready threads you would most likely use a priority queue, so that operations on it were O(log(N)). And if the ready list also included the unready list for some strange reason, operations on it would still be O(log(N)), i.e. less than linear in the total number of threads.
And if for some strange reason it was implemented in a less efficient way than that, I would complain vociferously to the vendor. Scheduling has been going on for fifty years after all.

Similar Messages

  • Ask  help  for a question about Caesar cipher

    "Caesar ciphers are among the simplest devised, and rely solely on remapping characters to others in the alphabet using a constant shift modulo the size of the alphabet. The amount shifted is the key used to encipher, or decipher, the message. This remapping is usually restricted to letters, so that with a key of 2, `A' is replaced by `C', `B' by `D', ..., `X' by `Z', `Y' by `A', and `Z' by `B'. Lower case letters are mapped in an identical way to give their lower case replacements. Thus here the key is an integer in the range 1 to 25 (not 0 to 25, as there is no point replacing every `A' by an `A' etc.).
    Straightforward Caesar ciphers are rather too easy to recognise however. In an attempt to maintain the basic idea, but complicate the result, what we will do is systemmatically jumble up the letters. Treating `I' and `J' as one letter from the start (so now there are only 24 different keys, assuming we still exclude mapping `A' to `A'), the 25 letters will be written to a 5 by 5 grid, by rows, and read back by columns. So, for example, with a key of 10, `A' is mapped into `L', and the grid produced is:
    L M N O P
    Q R S T U
    V W X Y Z
    A B C D E
    F G H I K
    and the uppercase alphabet upon encryption becomes: LQVAFMRWBBGNSXCHOTYDIPUZEK Note that here the `B' is doubled up because it represents both `I' and `J'. Thus, with this key of 10, the following line is enciphered to the one after it.
    Caesar ciphers are child's play.
    Vlfylt vbhwfty ltf vwbna'y hnle.
    An acceptable drawback of the treatment of `I' and `J' in the grid is that a decoded message will have all `J's mapped to `I's, and all `j's to `i's"
    this is a part of requirement in the whole program,I almost finished it, but I do not know thata how to make" a decoded message will have all `J's mapped to `I's, and all `j's to `i's". "Treating `I' and `J' as one letter from the start"?what does that mean?
    this is my code about the part:
    public static char encode(char ch,int n)  {
      while (!Character.isLetter(ch))
       return ch;
      if(ch>='A'&&ch<='Z')
      return (char)('A'+(ch-'A'+n)%26);
    if(ch>='a'&&ch<='z')
      return (char)('a'+(ch-'a'+n)%26);
    return ch;
    public static char decode(char ch,int n)  {
      while (!Character.isLetter(ch))
       return ch;
      if(ch>='A'&&ch<='Z')
      return (char)('A'+(ch-'A'-n)%26);
    if(ch>='a'&&ch<='z')
      return (char)('a'+(ch-'a'-n)%26);
    return ch;
    }but
    how to make" a decoded message will have all `J's mapped to `I's, and all `j's to `i's". "Treating `I' and `J' as one letter from the start"?

    Your teacher/instructor/professor would obviously be the final authority on this, but I think all it's saying is that when you encode, treat each 'j' you come across as an 'i', and therefore, when you decode, because you've lost information that it was a 'j' to start with, it will be mapped back to an 'i'.
    One easy way to accomplish this (that would save special cases later in your for-loop) would simply be a:
    String toEncode = "Djibouti"
    toEncode = toEncode.replaceAll("j","i"); //obviously handle both cases instead
    String encoded = encode(toEncode);
    String decoded = decode(encoded);
    System.out.println(decoded); //this would print "Diibouti"The other way is to simply add a special case to your encode/decode (char) methods.
    Edited by: endasil on 28-Sep-2009 9:35 AM

  • Performance Issue with Concurrent Program

    Hi Gurus,
    I have a loader program which updates some information in the OM sales orders, this is been done using oe_order_pub.process_order and I do not see any performance issue in the package.
    Using this program i had tried to update some huge number of orders uand it gets completed in few minutes, but at times this program runs for more than 6-7 hours even with
    Pls could anyone advise what could be the issue with this?
    Thanks & Regards,
    Genoo

    I have a loader program which updates some information in the OM sales orders, this is been done using oe_order_pub.process_order and I do not see any performance issue in the package.
    Using this program i had tried to update some huge number of orders uand it gets completed in few minutes, but at times this program runs for more than 6-7 hours even with
    Pls could anyone advise what could be the issue with this?Do you have the statistics collected up to date?
    Can you find any errors in the database log file?
    Any locks in the database?
    Any invalid objects?
    Please enable trace and generate the TKPROF file once the program is completed.
    Thanks,
    Hussein

  • Performance issue about using JDBC?

    Since no one reply me, I post again. :(
    I just got a big performance problem lately, and I tried all the possible ways, still can't fix it. Could you help me out or give me more suggestions?
    Oracle 8i for Solaris 2.6
    A web application with back end is Oracle database, developed by Java, use JDBC driver. It also uses Servelet. Report generated in browser is using dynamic SQL.
    When I click some link to generate report in browser, it will run the corresponding SQL script, then return the result to browser. The problem is it takes long long time to get the result. For simple query, it takes around 2-3 minutes. But if I run the same SQL script in
    SQL*Plus, it only takes 4-5 seconds, or even less. So I think the index for this query is fine. (I also rebuild all indices, some result.) And all the hit ratios in SGA are also OK. When browser generate reports, I didn't see high CPU usage or I/O activity.
    I really have no idea why this happens. But I think the Oracle DB is fine, 'cause query is run normally in SQL*Plus. The problem may related to the JDBC driver or JDBC connection. The developers also have no clue about this. When the Java app run the query, does it use the same way to access the tables and indexes as used in SQL*Plus?
    Any idea or suggestions?
    Thanks a lot and have a good day!
    null

    Thanks for all.
    So do you guys has any suggestion on the following code?
    DESCRIBE TABLE gt_vbeln LINES l_lines.
      IF l_lines = 0.
    ***>>Links20060411
    *  ELSEIF l_lines GT c_1000.
    *    SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
    *        APPENDING TABLE gt_vbfa_all PACKAGE SIZE c_1000
    *        FROM vbfa
    *        FOR   ALL ENTRIES IN gt_vbeln
    *        WHERE vbelv   EQ  gt_vbeln-vbelv
    *          AND posnv   EQ gt_vbeln-posnv
    *          AND vbtyp_n IN ('T', 'J', 'R', 'h').
    *    ENDSELECT.
    *  ELSE.
    *    SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
    *        INTO TABLE gt_vbfa_all FROM vbfa
    *        FOR   ALL ENTRIES IN gt_vbeln
    *        WHERE vbelv   EQ  gt_vbeln-vbelv
    *          AND posnv   EQ  gt_vbeln-posnv
    *          AND vbtyp_n IN ('T', 'J', 'R', 'h').
      ELSEIF l_lines > c_1000.
        SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
            APPENDING TABLE gt_vbfa PACKAGE SIZE c_1000
            FROM vbfa
            FOR   ALL ENTRIES IN gt_vbeln
            WHERE vbelv   =  gt_vbeln-vbelv
              AND posnv   = gt_vbeln-posnv
              AND vbtyp_n IN ('T', 'J').
        ENDSELECT.
      ELSE.
        SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
            INTO TABLE gt_vbfa FROM vbfa
            FOR   ALL ENTRIES IN gt_vbeln
            WHERE vbelv   =  gt_vbeln-vbelv
              AND posnv   =  gt_vbeln-posnv
              AND vbtyp_n IN ('T', 'J').
      ENDIF.
    Currently it runs timeout ,as the l_lines is very very large.
    I think maybe we  can change the package size. But what's the best package size for performance?
    Thanks..

  • Performance issue of Concurrency in TimesTen

    Hi,
    Our project is to test the performance of TimesTen. But we found performance issue when multi processes run concurrently.
    [Product Version]
    OS: HP-UX B.11.11 U 4CPU
    Oracle DB: 9.2.0.4 ??
    TimesTen: 7.0.2
    [Deployment Description]
    Oracle DB and TimesTen is respectively deployed in 2 HP-Unix servers, our application is deployed in the same machine with TimesTen, and our application is connected with TT in CS mode rather than direct connect.
    [Scenario Description]
    Our test program is quite simple, just use Transparent load to load data from oracle DB into TT cache group.
    the transparent load method we used is "select every field from table where id=:b"
    For example, there are 100k records in oracle DB. We unload the tt cache group and run the test program, in which every record is loaded into TT through "select" statement.
    [Performance Issue]
    If we just start one test process to load 10k records into TT from DB, it will cost 19s, If we add the test processes up to 4, and every process load different 10k records into TT from DB, it will cost 23s, Howver, if the test processes is up to 10, and every process load different 10k records into TT from DB, it will cost 55s I think the CPU is not the bottleneck, since in the three scenarios, every CPU used is no more than 40%. and the bandwidth is also sufficient, since we can load 100K records into TT from DB by full load in 8s.
    So, what cause the performance issue in high concurrency? Why the performance drops deeply when the number of concurrent processes is more than the number of CPU?

    Hi,
    What does the cache group definition look like please? How many CPUs are there in the Oracle server machine? What are the DSN settings for the datastore?
    If you are loading each record just once into TimesTen from Oracle using TransparentLoad (i.e. during the test run you SELECT each record just once) then you are actually primarily testing the performance of the Oracle DB rather than TimesTen since each SELECT will result in a SELECT in TimesTen, then a SELECT in Oracle (multiple SELECTS if the cache groups has multiple tables in it) followed by INSERT(s) into TimesTen. As long as your DSN settings are correct then the bottleneck here will almost certainly be the SELECTs in Oracle. I would take a look at the performance of the Oracle DB while the highly concurrent test is running.
    Chris

  • Help for performance tunning

    Hi Gurus,
    I m new to the group and SAP BW as well,so i need ur valuable inputs for a Performance related Project.
    I m going to start  a new project in a wks time so and i m working as a Performance Tuning Consultant on that(Load & Query Performance),but i don't have any idea about this,so i need ur valuable advice on that,plz.
    Can anyone plz suggest me the possible ways of suggestions so that i can tell the client as a gud consultant to start with but these days i m going though BW Performance & Authorization(BW360) which is really helpful for me but apart from that i need ur valuable inputs as well.
    Thanks in Advance.
    regards
    Amit

    hi Amit,
    check this.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef0168d41b6
    also
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/10b589ad-0701-0010-0299-e5c282b7aaad
    regards.

  • Need your help on performance issue please

    Hello everyone!
    I need your help to understand an effect I notice with a Thread class I built. I currently work on enhancement of my application Playlist Editor (see http://www.lightdev.com/page74.htm) and a new release will be available soon.
    Among other extensions the new release will have a title filter function which is based on audio data that is recursively read from ID3 tags of files found in a given root directory. The data collection is done by a CollectionThread class which reads into a data model class AudioDataModel and the entire process works fine, no problem with that.
    However, when my application is started for the first time the CollectionThread runs approximately 3 minutes to collect data from approximately 4300 audio files on an Intel Pentium M 1,4 GHz, 512 MB RAM, Windows XP SP2. When the application is shut down and started again, it takes only a few seconds to do the same task for all subsequent launches.
    I already tried to start the application with java option -Xms40m to increase initial heap size. This increases performance in general but the effect is still the same, i.e. first run lasts significantly longer than subsequent runs.
    I also tried to build a pool mechanism which creates many empty objects in the data model and then releases them to contain the actual data at is being read in but this did not lead to better performance.
    It must have to do with how Java (or Windows?) allocates and caches memory. I wonder whether there is a way to pre-allocate memory or if there are any other ideas to improve performance so that the process always only takes seconds instead of minutes?
    I attach the key classes to this message. Any help or ideas is much appreciated!
    Thanks a lot a best regards
    Ulrich
    PS: You can use the news subscription service at
    http://www.lightdev.com/dynTemplate.php4?id=80&dynPage=subscribe.php4 to be informed when the new release of Playlist Editor is available.
    All classes posted here do not need debugging, they already have proven to run error free. The classes are only posted for information for the interested reader - no need to go through all the stuff in detail - only if it interests you.
    My application calls class CollectionThread wich is a subclass of InfoThread. CollectionThread recursively goes through a directory and file structure and stores found ID3 tag information in instances of class ID3v11Tag which in turn gets stored in one instance of class AudioDataModel. All classes are shown below.
    This is the mentioned CollectionThread
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * do te actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        maxValue = -1;
        filesProcessed = 0;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(rootDir.listFiles());
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    i++;
    maxValue++;
    * recursively read data into model
    * @param files File[] the file array representing the content of a given directory
    private boolean collect(File[] files) {
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    This is class InfoThread
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    import java.util.Vector;
    import java.util.Enumeration;
    * Abstract class <code>InfoThread</class> implements a status and listener concept.
    * An <code>InfoThread</code> object actively informs all objects registered as listeners about
    * status changes, progress and possible exceptions. This way the status of a running
    * thread does not require a polling mechanism to be monitored.
    * <p>
    * <code>InfoThread</code> implements the following working scheme
    * </p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public abstract class InfoThread extends Thread {
       * construct an <code>InfoThread</code> object
       * <p>This class is meant to be used when a <code>Thread</code> object is needed that actively
       * informs other objects about its status</code>. It is a good idea therefore to register
       * one or more listeners with instances of this class before doing anything
       * else.</p>
       * @see addInfoThreadListener
      public InfoThread() {
       * set the amount of time this thread shall idle after it is through with one
       * work cycle and before a next work cycle is started. This influences the time
       * other threads have for their work.
       * @param millis long  the number of milliseconds to idle after one work cycle
      public void setIdleMillis(long millis) {
        idleMillis = millis;
       * Causes this thread to begin execution; the Java Virtual Machine calls the <code>run</code>
       * method of this thread. Calls method <code>prepareThread</code> before calling
       * <code>run</code>.
       * @see run
       * @see prepareThread
      public synchronized void start() {
        setStatus(STATUS_INITIALIZING);
        prepareThread();
        setStatus(STATUS_READY);
        super.start();
       * call method <code>start</code> instead of this method.
       * calling this method directly will lead to an exception
       * @see start
      public void run() {
        //System.out.println("InfoThread.run");
        if (status == STATUS_READY) {
          boolean workIsLeft = true;
          setStatus(STATUS_RUNNING);
          while (status < STATUS_STOP_PENDING && workIsLeft) {
            if (status < STATUS_HALT_PENDING) {
              workIsLeft = work();
              if(!workIsLeft) {
                setStatus(STATUS_WORK_COMPLETE);
            if (status == STATUS_HALT_PENDING) {
              setStatus(STATUS_HALTED);
            else if (status == STATUS_STOP_PENDING) {
              setStatus(STATUS_STOPPED);
            else {
              try {
                sleep(idleMillis);
              catch (InterruptedException e) {
                fireThreadException(e);
        else {
          // error: Thread is not ready to run
        setStatus(STATUS_THREAD_FINISHED);
       * stop this thread. This will terminate the thread irrevokably. Use method
       * <code>haltThread</code> to pause a thread with the possiblity to resume work later.
       * @see haltThread
      public void stopThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be stopped, when it is not running
            break;
       * halt this thread, i.e. pause working allowing to resume later
       * @see resumeThread
      public void haltThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be halted, when it is not running
            break;
       * resume this thread, i.e. resume previously halted work
       * @see haltThread
      public void resumeThread() {
        if(status == STATUS_HALTED || status == STATUS_HALT_PENDING) {
          setStatus(STATUS_RUNNING);
        else {
          // exception: only halted threads or threads that are about to halt can be resumed
       * this is the method to prepare a thread to run. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> can implement this method to do anything
       * that might be required to put their thread into STATUS_READY. This method is called
       * automatically by method <code>start</code>.  When implementing this method, it should
       * call method <code>fireThreadException</code> accordingly.
       * @see start
       * @see fireThreadException
      protected void prepareThread() {
        // does nothing in this abstract class but might be needed in subclasses
       * this is the main activity method of this object. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> must implement this method to do something
       * meaningful. When implementing this method, it should call methods
       * <code>fireThreadProgress</code> and <code>fireThreadException</code> accordingly.
       * @return boolean true, if work is left, false if not
       * @see fireThreadProgress
       * @see fireTreadException
      protected abstract boolean work();
       * add an <code>InfoTreadListener</code> to this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to add
       * @see removeInfoThreadListener
      public void addInfoThreadListener(InfoThreadListener l) {
        listeners.add(l);
       * remove an <code>InfoTreadListener</code> from this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to remove
      public void removeInfoThreadListener(InfoThreadListener l) {
        listeners.remove(l);
       * notify all <code>InfoThreadListener</code>s of a status change
       * @param fromStatus int  the status tis thread had before the change
       * @param toStatus int  the status this thread has now
      protected void fireThreadStatusChanged(int fromStatus, int toStatus) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadStatusChanged(this, fromStatus, toStatus);
       * notify all <code>InfoThreadListener</code>s of an exception in this thread
       * @param ex Exception  the exception that occurred
      protected void fireThreadException(Exception ex) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadException(this, ex);
       * notify all <code>InfoThreadListener</code>s of the progress of this thread
       * @param progressValue long  a value indicating the current thread progress
      protected void fireThreadProgress(long progressValue) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadProgress(this, progressValue, maxValue);
       * set the status of this thread and notify all listeners
       * @param newStatus int  the status this thread is to be changed to
      private void setStatus(int newStatus) {
        //System.out.println("InfoThread.setStatus oldStatus=" + status + ", newStatus=" + newStatus);
        int fromStatus = status;
        status = newStatus;
        fireThreadStatusChanged(fromStatus, newStatus);
       * get the current status of this thread
       * @return int  the status
      public int getStatus() {
        return status;
       * cleanup before actual destruction.
      public void destroy() {
        //System.out.println("InfoThread.destroy");
        cleanup();
        super.destroy();
       * cleanup all references this thread maintains
      private void cleanup() {
        //System.out.println("InfoThread.cleanup");
        listeners.removeAllElements();
        listeners = null;
      /* ----------------------- class fields start ------------------------ */
      /** storage for the objects this thread notifies about status changes and progress */
      private Vector listeners = new Vector();
      /** indicator for the status of this thread */
      private int status = STATUS_NONE;
      /** maximum value for threadProgress */
      protected long maxValue = -1;
      /** the idle time inside one work cycle in milliseconds */
      protected long idleMillis = 1;
      /* ----------------------- class fields end -------------------------- */
      /* ----------------------- constants start --------------------------- */
      /** constant value indicating that no status has been set so far */
      public static final int STATUS_NONE = 0;
      /** constant value indicating that the thread is currently initializing */
      public static final int STATUS_INITIALIZING = 1;
      /** constant value indicating that the thread is ready to run */
      public static final int STATUS_READY = 2;
      /** constant value indicating that the thread is running */
      public static final int STATUS_RUNNING = 3;
      /** constant value indicating that the thread is about to halt */
      public static final int STATUS_HALT_PENDING = 4;
      /** constant value indicating that the thread is halted */
      public static final int STATUS_HALTED = 5;
      /** constant value indicating that the work of this thread is complete */
      public static final int STATUS_WORK_COMPLETE = 6;
      /** constant value indicating that the thread is about to stop */
      public static final int STATUS_STOP_PENDING = 7;
      /** constant value indicating that the thread is stopped */
      public static final int STATUS_STOPPED = 8;
      /** constant value indicating that the thread is finished */
      public static final int STATUS_THREAD_FINISHED = 9;
      /* ----------------------- constants end --------------------------- */
    }this is the InfoThreadListener interface
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    * An interface classes interested to receive events from objects
    * of class <code>InfoThread</code> need to implement.
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public interface InfoThreadListener {
       * method to receive a status change notification from a thread
       * @param thread InfoThread  the thread which status changed
       * @param fromStatus int  the status which the thread had before the change
       * @param toStatus int  the status which the thread has now
      public void threadStatusChanged(InfoThread thread, int fromStatus, int toStatus);
       * method to receive a notification about the progress of a thread
       * @param thread InfoThread  the thread which notified about its progress
       * @param progressValue long  the value (e.g. 10 if 100 percent completed, 20 of 1 million files processed, etc.)
      public void threadProgress(InfoThread thread, long progressValue, long maxValue);
       * method to receive a notifiaction about the fact that an exception occurred in a thread
       * @param thread InfoThread  the thread for which an exception occurred
       * @param e Exception  the exception that occurred
      public void threadException(InfoThread thread, Exception e);
    }This is class AudioFileDescriptor
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class models characteristics of an audio file such as the absolute path
    * of the file, its tag contents (if any) and the play duration, etc.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class AudioFileDescriptor implements Serializable, Comparable {
      public AudioFileDescriptor(String absolutePath) throws FileNotFoundException, IOException {
        load(absolutePath);
      public boolean equals(Object o) {
        if(o != null && o instanceof AudioFileDescriptor) {
          return ((AudioFileDescriptor) o).getAbsolutePath().equalsIgnoreCase(this.getAbsolutePath());
        else {
          return false;
      public void load(String absolutePath) throws FileNotFoundException, IOException {
        this.absolutePath = absolutePath;
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        if(id3v11Tag == null) {
          id3v11Tag = new ID3v11Tag(rf, false);
        else {
          id3v11Tag.readTag(rf, rf.length() - 128);
        rf.close();
      public String getAbsolutePath() {
        return absolutePath;
      public ID3v11Tag getID3v11Tag() {
        return id3v11Tag;
      public void setID3v11Tag(ID3v11Tag tag) {
        this.id3v11Tag = tag;
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return id3v11Tag.getArtist() + ", " + id3v11Tag.getAlbum() + " - " +
            df.format(id3v11Tag.getTrackNumber()) + " " + id3v11Tag.getTitle();
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *   or greater than the specified object.
       * @todo Implement this java.lang.Comparable method
      public int compareTo(Object o) {
        return toString().compareTo(o.toString());
      private String absolutePath;
      private ID3v11Tag id3v11Tag;
      private transient long duration = -1;
      private transient int type = TYPE_UNKNOWN;
      public static final transient int TYPE_UNKNOWN = 0;
      public static final transient int TYPE_MP3 = 1;
    }This is class ID3V11Tag into which the data is actually stored
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.File;
    import java.io.RandomAccessFile;
    import java.io.IOException;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class is a very simple implementation of an ID3v11Tag. It models an ID3 tag
    * pretty much the same way as it is physically stored inside an audio file.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class ID3v11Tag implements Serializable, Comparable {
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor can be used for cases where a RandomAccessFile has already
       * been opened and will be closed elsewhere</p>
       * @param rf RandomAccessFile  the open file to read from
       * @param isAtTagStartPos boolean  true, if the file pointer is at the
       * position where the ID3 tag starts; when false, the pointer is positioned accordingly here
       * @throws IOException
      public ID3v11Tag(RandomAccessFile rf, boolean isAtTagStartPos) throws IOException {
        if(isAtTagStartPos) {
          readTag(rf);
        else {
          readTag(rf, rf.length() - 128);
       * construct an ID3v11Tag and read tag content from a file at a given location
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param absolutePath String  the absolute path to the audio file to open
       * @throws IOException
      public ID3v11Tag(String absolutePath) throws IOException {
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        readTag(rf, rf.length() - 128);
        rf.close();
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param audioFile File  the audio file to read from
       * @throws IOException
      public ID3v11Tag(File audioFile) throws IOException {
        this(audioFile.getAbsolutePath());
       * get a string representation of this object
       * @return String
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return getArtist() + ", " + getAlbum() + " - " + df.format(getTrackNumber()) + " " + getTitle();
       * position to file pointer and read the tag
       * @param rf RandomAccessFile  the file to read from
       * @param jumpPos long  the position to jump to (the tag start position)
       * @throws IOException
      public void readTag(RandomAccessFile rf, long jumpPos) throws IOException {
        rf.seek(jumpPos);
        readTag(rf);
       * read the tag from a given file, assuming the file pointer to be at the tag start position
       * @param rf RandomAccessFile  the file to read from
       * @throws IOException
      public void readTag(RandomAccessFile rf) throws IOException {
        rf.read(tagBuf);
        if(tag.equalsIgnoreCase(new String(tagBuf))) {
          rf.read(title);
          rf.read(artist);
          rf.read(album);
          rf.read(year);
          rf.read(comment);
          rf.read(trackNo);
          rf.read(genre);
      public String getTitle() {
        return new String(title).trim();
      public String getArtist() {
        return new String(artist).trim();
      public String getAlbum() {
        return new String(album).trim();
      public String getYear() {
        return new String(year).trim();
      public String getComment() {
        return new String(comment).trim();
      public int getGenreId() {
        try {
          int id = new Byte(genre[0]).intValue();
          if(id < GENRE_ID_MIN || id > GENRE_ID_MAX) {
            return GENRE_ID_OTHER;
          else {
            return id;
        catch(Exception ex) {
          return GENRE_ID_OTHER;
      public String getGenreName() {
        return genreNames[getGenreId()];
      public int getTrackNumber() {
        try {
          return (int) trackNo[0];
        catch(Exception e) {
          return 0;
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Franck,
    thank you, mate. I did what you suggested (changed class attached) but that did not change the mentioned behaviour.
    The first run is approximately 75 seconds with Java option -Xms40m and approx. double without, the second run and all subsequent runs are only 2-3 seconds each (!!!) even when terminating and re-starting the application between thread runs.
    I'm pretty clueless about that, any more help on this anyone?
    Thanks a lot and best regards
    Ulrich
    PS: BTW, I forgot to post the class that is filled with data by class CollectionThread, so here it is
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import java.io.File;
    import com.lightdev.lib.audio.ID3v11Tag;
    import javax.sound.sampled.UnsupportedAudioFileException;
    import java.io.IOException;
    import java.io.Serializable;
    import com.lightdev.lib.audio.AudioFileDescriptor;
    import com.lightdev.lib.ui.SortListModel;
    import java.util.Iterator;
    * Storage model for audio data.
    * <p>
    * <code>AudioDataModel</code> can be used to store ID3 tag data collected from
    * a directory with audio files to perform queries and reports on the found data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 15, 2004
    public class AudioDataModel extends SortListModel implements Serializable {
       * constructor
      public AudioDataModel() {
       * add an audio track from a given audio file
       * <p>This will attempt to read ID3 tag data from the file.</p>
       * @param audioFile File  the file to add audio data for
       * @throws IOException
      public void addTrack(File audioFile) throws IOException {
        AudioFileDescriptor afd = new AudioFileDescriptor(audioFile.getAbsolutePath());
        if (!data.contains(afd)) {
          data.add(afd);
       * get all tracks for agiven combination of genre name, artist name and album name. Any of
       * the parameters may be null or AudioDataModel.FILTER_ALL
       * <p>Ugly code, I know, but it simply hard codes all combinations of the the mentioned
       * parameters. Any more elegant implementations welcome.</p>
       * @param genreName String  a genre name to get tracks for
       * @param artistName String  an artist name to get tracks for
       * @param albumName String  an album name to get tracks for
       * @return SortListModel   the found tracks in a list model
      public SortListModel getTracks(String genreName, String artistName, String albumName) {
        SortListModel foundTracks = new SortListModel();
        Iterator e = data.iterator();
        while(e.hasNext()) {
          AudioFileDescriptor afd = (AudioFileDescriptor) e.next();
          ID3v11Tag tag = afd.getID3v11Tag();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if (tag.getAlbum().equalsIgnoreCase(albumName))
                foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
          else {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
        foundTracks.sort();
        return foundTracks;
       * list all artists in this model
       * @return SortListModel
      public SortListModel listArtists() {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          if (artists.indexOf(artistName) < 0) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all artists in this model having titles belonging to a given genre
       * @param genreName String  name of the genre artists are searched for
       * @return SortListModel
      public SortListModel listArtists(String genreName) {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          String genre = tag.getGenreName();
          if (artists.indexOf(artistName) < 0 && genre.equalsIgnoreCase(genreName)) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all genres in this model
       * @return SortListModel
      public SortListModel listGenres() {
        SortListModel genres = new SortListModel();
        genres.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String genreName = tag.getGenreName();
          if (genres.indexOf(genreName) < 0) {
            genres.add(genreName);
        genres.sort();
        return genres;
       * list all albums in this model
       * @return SortListModel
      public SortListModel listAlbums() {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          if (albums.indexOf(albumName) < 0) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre
       * @param genreName String  name of the genre albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          if (albums.indexOf(albumName) < 0 && genre.equalsIgnoreCase(genreName)) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre and artist
       * @param genreName String  name of the genre albums are searched for
       * @param artistName String  name of the artist albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName, String artistName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          String artist = tag.getArtist();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if (albums.indexOf(albumName) < 0 &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
          else {
            if (albums.indexOf(albumName) < 0 &&
                genre.equalsIgnoreCase(genreName) &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
        albums.sort();
        return albums;
       * get the number of audio tracks stored in this data model
       * @return int  the number of tracks
      public int getTrackCount() {
        return data.size();
      /** constant to select all items of a given part */
      public static final String FILTER_ALL = "    all";
    }...and here the changed CollectionThread now caching found File objects in a vector
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    import java.util.Vector;
    import java.util.Enumeration;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * this is the method to prepare a thread to run.
      protected void prepareThread() {
        maxValue = -1;
        filesProcessed = 0;
        innerCount = 0;
        fileList = new Vector();
       * do the actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(); //collect(rootDir.listFiles());
          fileList.clear();
          fileList = null;
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    else {
    fileList.add(file);
    i++;
    maxValue++;
    * read data into model
    * @param files File[] the file array representing the content of a given directory
    * @return boolean true, if work is left
    private boolean collect(/*File[] files*/) {
    Enumeration files = fileList.elements();
    while(files.hasMoreElements() && getStatus() < STATUS_HALT_PENDING) {
    File file = (File) files.nextElement();
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    filesProcessed++;
    if(++innerCount > 99) {
    innerCount = 0;
    fireThreadProgress(filesProcessed);
    return false;
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    /** a list to temporary store found files */
    private Vector fileList;
    /** counter to determine when to fire progress messages */
    private int innerCount = 0;

  • I cant get help for same issue lasting over 19 months now!!!

    This is a long issue here but everything is available to see per Verizon in the notes. I have tried many many times to get assistance and I am getting no where with the many customer service reps that I have spoken to.
    The issue started in September 2013 with my home fusion account. I had had it for several months with no issues.  Then 1 day after my billing schedule I started receiving text messages saying my usage was almost over the 10GB again in 1 day. I called to ask customer service what the deal was. I was told that perhaps since its just the 1 day after my billing schedule perhaps the system is just overlapping. I was told to give it a few days and it should straighten itself out. I did as told but kept receiving the text messages saying the overage was still pulling GB. I called back and a new gentleman told me to go ahead and unplug the unit until we figure it out. I did as told. However by this point I had racked up about $1500 of overages. The tech department could not say anything but that it was some cloud based service pulling the GB. We have no such thing and live on 30 acres in the woods with no one around as they said perhaps someone else was using our wifi. That wasn't possible but yet they still said it was something we did.   After some months going back and forth we finally agreed on a settling point where they paid a small portion and I paid the majority.  fast forward three months or so and I was still being charged the $100 month for a unit I was told to unplug. I called and said this was suppose to be cancelled back in October when we had the issues as we were not going to chance having another issue like this.  They lady said dhe would take care of it.  A few months later I called from the Verizon store and talked with another gentleman.  Again he said yes I see all the notes and issues and he would send up a note to the home fusion department to have that cancelled. I was ok with that. A few more motnhs go by and I STILL was being charged the $100 fee. I called again spoke to another lady and again was told it would be taken care of.  Then in about june or July 14 I called again and got to speak with a supervisor again. She looked in the notes, agreed it was suppose to be done sometime ago. I ask her how will that work with a refund as I been paying all this time for something unplugged that was suppose to be canceled. She said what I needed to do as the amount was too high for her to approve was email corporate. I got the information from her and did so. At that point I thought it was cancelled and then now I need to just figure out the refund part with corporate. Now all the sudden the charge appears back on my account. When I call they said it was suspended for vacation. Why would I need to suspend the account for vacation when it had not been used nor showed usuage on their end in nearly a year. So here we are now. After many emails to distrist managers, dozens of calls to customer service, and more no one has ever called back to follow up like many of the reps said they would. I was told there would be a $200 cancellation fee in the beginning when I was told to unplug device which I was fine with as I couldn't afford another $1500 bill if the receiver went crazy again..  19 MONTHS later this is still not solved and NO ONE has done anything they promised in regards to contacting me after I say that that's what the last rep said and they said NO but we definently will.  What do I do?

    The only sort of credit I was recieved was yesterday because apparently in
    October 14 instead of cancelling the person suspended the account for
    vacation use and it came back on and I was being charged again for last few
    months so they returned $198 for the last couple months of charges but then
    charged me $140 to cancel.  The deal is this should have been canceled in
    early 14 and I can not get anyone to help in regards to all those months I
    was charged then. The rep yesterday kept trying to send me to financial
    care to discuss that but I know good and we'll that financial care can not
    handle any credits etc. So it was a year of left I was being charged. As
    far as tickets they had opened tickets in the past in regards why the
    overage occurred which we "resolved" but my issue has been the lack of
    cancellation after many request way prior and the fact I was told to unplug
    the unit in case it was the unit. It was unplugged in Sept 2013 and never
    plugged back in. They show no use had ever been used since then, they know
    we had a issue, but still charged me for a year for the service.  The other
    part that really bothers me was when the overage was occurring was they
    said they would upgrade it to tech. I called back 2 weeks later and it
    still hadnt been upgraded to tech. As soon as it was upgraded they called
    and said jnplug.  But during that 2 week period it caused a $1000 of
    overage.  I have email confirmations of this where the tech apologized for
    not getting it up the the correct department but said I was still liable
    for the charged occurring through that time even though if he would have
    sent it that day instead of 2 weeks later we would have known to unplug
    then and avoid that extra $1000 in charges.  I have and would be willing to
    share those emails with anyone. I was put in a corner to try and pay that
    so that my phone lines would stay active as verizon is the only thing that
    works here and they said it would go against my credit.  Again email
    aknowledgement saying they didn't get the issue up to the tech for 2 weeks
    and during that time the issue ran many GB but I was still responsible for
    the charges even though when they did get it to them like they were suppose
    to the first time problem was "solved" right away by being told to unplug
    unit.  Even when I tell reps that I have all these emails from techs
    adwaynd reps showing these things they have never asked to see them or
    anything. They say  no computer says it was your fault.  I just don't
    understand.
    On Mar 31, 2015 10:31 PM, "Verizon Wireless Customer Support" <

  • Help with Performance issue with a view

    Hi
    We developed a custom view to get the data from gl_je_lines table with source as Payables. We are bringing the data for the last year and current year till date ie., from 01-JAN-2012 to SYSDATE. This view is in a package body, which is called from a concurrent program to write the data to a outbound file.
    The problem I am facing is that this view is fetching around 72 lakhs of records for the above date range and the program is running for a long time and completes abruptly with out any result. Can anyone please let me know if there is an alternative to this. I checked the view query and there seems to be not much scope to improve the performance.
    Will inserting al this data into a Global Temporary Table will help? Please revert at the earliest as this solution is very urgent for our clients.
    Message was edited by: 988490e8-2268-414d-b867-9d9a911c0053

    This is the view query:
    select GCC.SEGMENT1 "EMPRESA",
           GCC.SEGMENT2 "CCUSTO",
           GCC.SEGMENT3 "CONTA",
           GCC.SEGMENT4 "PRODUTO",
           GCC.SEGMENT5 "SERVICO",
           GCC.SEGMENT6 "CANAL",
           GCC.SEGMENT7 "PROJECT",
           GCC.SEGMENT8 "FORWARD1",
           GCC.SEGMENT9 "FORWARD2",
           FFVT.DESCRIPTION "CONTA_DESCR",
           ltrim(substr(XRX_CONSOLIDATION_MAPPING('XDMO_LOCAL_USGAAP_LEGAL_ENTITY',
                                                  'XDMO_REPORT_USGAAP_LEGAL_COMPANY',
                                                  GCC.SEGMENT1,
                                                  GCC.SEGMENT3),
                        1,
                        80)) "LEGAL_COMPANY",
           ltrim(substr(XRX_CONSOLIDATION_MAPPING('XDMO_LOCAL_USGAAP_ACCOUNT',
                                                  'XDMO_REPORT_USGAAP_FIN_ACCOUNT',
                                                  GCC.SEGMENT3,
                                                  GCC.SEGMENT3),
                        1,
                        80)) "GRA",
           ltrim(substr(XRX_CONSOLIDATION_MAPPING('XDMO_LOCAL_USGAAP_BUDGET_CENTER',
                                                  'XDMO_REPORT_USGAAP_RESPONSIBILITY',
                                                  GCC.SEGMENT2,
                                                  GCC.SEGMENT3),
                        1,
                        80)) "RESP",
           ltrim(substr(XRX_CONSOLIDATION_MAPPING('XDMO_LOCAL_USGAAP_PRODUCT',
                                                  'XDMO_REPORT_USGAAP_TEAM',
                                                  GCC.SEGMENT4,
                                                  GCC.SEGMENT3),
                        1,
                        80)) "TEAM",
           ltrim(substr(XRX_CONSOLIDATION_MAPPING('XDMO_LOCAL_USGAAP_ACCOUNT',
                                                  'XDMO_REPORT_USGAAP_FIN_ACCOUNT',
                                                  GCC.SEGMENT3,
                                                  GCC.SEGMENT3),
                        164,
                        80)) "GRA_DESCR",
           GJH.NAME "IDLANC",
           GJS.USER_JE_SOURCE_NAME "ORIGEM",
           GJC.USER_JE_CATEGORY_NAME "CATEGORIA",
           GJL.DESCRIPTION "DESCRICAO",
           decode(GJH.JE_SOURCE, 'Payables', GJL.REFERENCE_2, '') "INVOICE_ID",
           decode(GJH.JE_SOURCE, 'Payables', GJL.REFERENCE_5, '') "NOTA",
           decode(GJH.JE_SOURCE, 'Payables', GJL.REFERENCE_1, '') "FORNECEDOR",
           GJH.DEFAULT_EFFECTIVE_DATE "DTEFET",
           to_char(GJB.POSTED_DATE, 'DD-MON-YYYY HH24:MI:SS') "DTPOSTED",
           GJH.CURRENCY_CONVERSION_TYPE "TPTAX",
           substr(GCC.SEGMENT9, 8, 1) "TAXA",
           GJH.CURRENCY_CONVERSION_DATE "DTCONV",
           -- nvl(GJL.ACCOUNTED_DR,0)-nvl(GJL.ACCOUNTED_CR,0)       "VALOR",
           -- added as per ITT #517830
           nvl(GJL.ENTERED_DR, 0) - nvl(GJL.ENTERED_CR, 0) "VALOR",
           GJH.CURRENCY_CODE "MOEDA",
           --  decode(gcc.segment9, '00000000', 0, '00000001', nvl(GJL.ACCOUNTED_DR,0)-nvl(GJL.ACCOUNTED_CR,0)) "VALOR_FUNCIONAL",
           -- added as per ITT #517830
           (nvl(GJL.ACCOUNTED_DR, 0) - nvl(GJL.ACCOUNTED_CR, 0)) "VALOR_FUNCIONAL",
           GSOB.CURRENCY_CODE "FUNCIONAL",
           GJH.PERIOD_NAME "PERIODO",
           GJB.STATUS "STATUS",
           GSOB.SHORT_NAME "LIVRO",
           GJL.LAST_UPDATE_DATE "JL_LAST_UPDATE_DATE",
           GJH.LAST_UPDATE_DATE "JH_LAST_UPDATE_DATE",
           GJB.LAST_UPDATE_DATE "JB_LAST_UPDATE_DATE",
           GJL.JE_HEADER_ID "JE_HEADER_ID",
           GJL.JE_LINE_NUM "JE_LINE_NUM"
      from GL.GL_JE_LINES   GJL,
           GL.GL_JE_HEADERS GJH,
           GL.GL_JE_BATCHES GJB,
           --GL.GL_SETS_OF_BOOKS                    GSOB, ---As GL_SETS_OF_BOOKS table dropped in R12 so replaced with GL_LEDGERS table,Commented as part of DMO R12 Upgrade-RFC#411290.
           GL.GL_LEDGERS               GSOB, ---Added as part of DMO R12 Upgrade-RFC#411290.
           GL.GL_JE_SOURCES_TL         GJS,
           GL.GL_JE_CATEGORIES_TL      GJC,
           GL.GL_CODE_COMBINATIONS     GCC,
           APPLSYS.FND_FLEX_VALUES_TL  FFVT,
           APPLSYS.FND_FLEX_VALUES     FFV,
           APPLSYS.FND_FLEX_VALUE_SETS FFVS
    where GJL.CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
       and GJL.JE_HEADER_ID = GJH.JE_HEADER_ID
       and GJH.JE_BATCH_ID = GJB.JE_BATCH_ID
          --and GJB.SET_OF_BOOKS_ID = GSOB.SET_OF_BOOKS_ID    ---Changing the mappings between the tables GL_JE_HEADERS and GL_JE_BATCHES As column SET_OF_BOOKS_ID of table GL_JE_BATCHES dropped in R12,Commented as part of DMO R12 Upgrade-RFC#411290.
       and GJH.LEDGER_ID = GSOB.LEDGER_ID ---Added as part of DMO R12 Upgrade-RFC#411290.
       and GJH.JE_SOURCE = GJS.JE_SOURCE_NAME
       and GJH.JE_CATEGORY = GJC.JE_CATEGORY_NAME
       and GCC.SEGMENT3 = FFV.FLEX_VALUE
       and FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
       and FFV.FLEX_VALUE_SET_ID = FFVS.FLEX_VALUE_SET_ID
       and FFVS.FLEX_VALUE_SET_NAME = 'XDMO_LOCAL_USGAAP_ACCOUNT'
       and GSOB.SHORT_NAME in ('XBRA BRL LOCAL GAAP', 'XBRA BRL USGAAP')
       and gcc.chart_of_accounts_id = gsob.chart_of_accounts_id
       and gjh.actual_flag = 'A'
    DB VErsion: 11.2.0.3.0
    The problem I am facing is that the above query fetches huge data and I want to know if there is anyway to improve the performance of this query. You are right that view is stored in DB. I am using this view query in a cursor to fetch the records

  • How application module helps for performance improve

    Hi Everyone,
    I have a sample web-application in which I am connecting with single AM instance (AM for database view object), retrieving some information and then close the connection. I am doing this as,
    // making AM instance
    <application module instance> = Configuration.createRootApplicationModule(<AM name>, config);
    // performing operations
    <operation result> = <application module instance>.<access VO with any operation>();
    System.out.println("Get result here");
    // disconnecting AM instance
    <application module instance>.getDBTransaction().disconnect();
    Configuration.releaseRootApplicationModule(<application module instance>, true);
    These are the activities which are performed by a single user. Now, I am doing stress test on same activities. I am testing the same code with 300 concurrent users (using JMeter with JSP URL). These are working fine. Also I checked multiple times, it always working fine.
    Now, I need to do something through which I can improve the performance. I know, I can use AM pool configurations to make this more effective. I have gone through the Oracle documents and checked the same test case with default or recommended pool configurations and I found similar kind of results (there is not much difference).
    On other hand, I tried with 'releaseRootApplicationModule' method with false parameter and found better results in default as well as recommended pool configurations.
    My question is, is the change of pool configurations recommended by Oracle really work? or do I need to concentrate more on coding part with default pool configurations?
    Here, I would like to know, what are the best practice (in code as well as pool configurations), I need to follow if I really want to improve the performance in real scenarios (when our application will access with large no. of concurrent users).
    I really look forward some help from experts. I have given a lot of time on this to know how really we can make our application more effective in terms of performance.
    I really appreciate for your reply.
    Regards,
    Dilip Gupta.

    >
    We added the createRootApplicationModule() API (in the oracle.jbo.client.Configuration class) to simplify acquiring an application module from the pool for brief programmatic manipulation before it is released back to the AM pool.
    Steve Muench.
    >
    check [url http://radio-weblogs.com/0118231/2009/08/20.html#a959]Check Your App for Misuse of Configuration.createRootApplicationModule()
    Edited by: Mohammad Jabr on May 10, 2012 7:14 AM

  • Possible performance issue about DB table kmc_dbrm_contract

    Hello,
    We've just completed load tests for a large portal.
    EP 6.40 SP20
    During these tests, DB people have identified some contention on this particular table, which contains only three records.
    The "offending" query seems rather fast and is just incrementing a counter. The reason for the contention is that we had a very large number os such queries, resulting on multiple locks, that could last up to a maximum of 1,5 seconds.
    This is not related to our project developements and therefore I assume this is a portal standard.
    Can you help me finding what this table is all about and if there is anything standard we can do to explain and/or prevent this slight delay?
    I'm not a technology expert (just a PM), so I would appreciate a rather detailed response.
    Thank you,
    Luis C Leme

    Hello,
    This is known behavior (see http://help.sap.com/saphelp_nw70ehp3/helpdata/en/62/468698a8e611d5993600508b6b8b11/frameset.htm) when FSDB Repository is used and its option "Enable FSDB Content Tracking" is ticked.
    The part of official docuementation says:
    The database synchronization of content access might have a negative impact on performance. Every read or write content request to an FSDB resource waits to obtain a write lock on the lock record in the database. Therefore, the accumulated waiting time for obtaining the write lock in the database might increase and the waiting threads might consume a considerable amount of the available threads in the thread pool.
    Best Regards,
    Georgi

  • Need help for study work (About Java)

    Hello all,
    I am student and I am writing bachelor work for Riga Technical University (Java technology in telecommunications) and I want to know what will be the correct Java technologies about which I can write?
    Does anyone have idea or can give me content?
    Thanks.
    Regards,
    Girts

    I am student and I am writing bachelor work for Riga Technical University (Java technology in telecommunications) and I want to know what will be the correct Java technologies about which I can write?Ask your instructor.
    Seriously.
    I'm not intending any insult by being dismissive, but it just doesn't make sense to ask that question here. If you have questions about your academic curriculum, the place to resolve those questions are with your institution.
    Does anyone have idea or can give me content?If you're just hunting for ideas, do a little research to find a topic interesting to you and pertinent to your course. That's your responsibility as a student.
    That said, what I think would be a decent enough question for the forum would be, "I've done some looking into X as it relates to the Java platform, and I've come to the conclusion that Y. What issues, concerns, or feedback do you see regarding my conclusion?" And then people can answer and discuss as they choose.
    ~

  • Need help for performance tunning

    Hello,
    I have 16K records return by query, it takes long time to proceed for 7K it takes 7.5 sec.
    Note: I used all seeded tables only.
    If possible please help me to tune it.
    SELECT       msi.inventory_item_id,msi.segment1,msi.rimary_uom_code , msi.primary_unit_of_measure
    FROM  mtl_system_items_b msi, qp_list_lines qpll,qp_pricing_attributes qppr,
              mtl_category_sets_tl mcs,mtl_category_sets_b mcsb,
              mtl_categories_b mc, mtl_item_categories mcb
    WHERE     msi.enabled_flag = 'Y'
         AND qpll.list_line_id = qppr.list_line_id
         AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id(+))
         AND qppr.product_uom_code = msi.primary_uom_code
         AND mc.category_id = mcb.category_id
         AND msi.inventory_item_id = mcb.inventory_item_id
         AND msi.organization_id = mcb.organization_id
         AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,TRUNC (SYSDATE)) AND NVL (qpll.end_date_active,TRUNC (SYSDATE))
         AND mcs.category_set_name = 'LSS SALES CATEGORY'
         AND mcs.language = 'US'
         AND mcs.category_set_id = mcsb.category_set_id
         AND mcsb.structure_id = mc.structure_id
         AND msi.organization_id = :p_organization_id
         AND qpll.list_header_id = :p_price_list_id
         AND mcb.category_id = :p_category_id;
    Thanks and regards
    Akil.

    Thanks Helios ,
    here is answers
    Databse version
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit  
    PL/SQL Release 11.1.0.7.0
    explain plan
    | Id  | Operation                       | Name                     | Rows  | Bytes | Cost (%CPU)|

    0 | SELECT STATEMENT              
    |                          |   
    1 |   149 |  9439 
    (1)|

    1 |  NESTED LOOPS                   |                          |     1 | 
    149 |  9439   (1)|
    |*
    2 |   HASH JOIN OUTER               |                          |     1 | 
    135 |  9437   (1)|
    |*
    3 |    HASH JOIN                    |                          |     1 |  
    71 |  9432   (1)|

    4 |     NESTED LOOPS                |                          |     2 |  
    76 |    53   (0)|
    |*
    5 |      TABLE ACCESS BY INDEX
    ROWID| QP_LIST_LINES            |     2 |  
    44 |    49   (0)|
    |*
    6 |       INDEX SKIP SCAN           | QP_LIST_LINES_N2         | 
    702 |       |    20 
    (0)|
    |*
    7 |      INDEX RANGE SCAN           | QP_PRICING_ATTRIBUTES_N3 |     1 |  
    16 |     2   (0)|
    |*
    8 |     TABLE ACCESS BY INDEX
    ROWID | MTL_SYSTEM_ITEMS_B       | 46254
    |  1490K|
    9378   (1)|
    |*
    9 |      INDEX RANGE SCAN           | MTL_SYSTEM_ITEMS_B_N9    | 46254 |       | 
    174   (1)|
    |
    10 |    TABLE ACCESS FULL            | XX_WEB_ITEM_IMAGE_TBL    | 
    277 | 17728 |     5   (0)|
    |* 11 |   INDEX RANGE SCAN              | MTL_ITEM_CATEGORIES_U1   |   
    1 |    14 |     2 
    (0)|
    Predicate Information (identified
    by operation id):
    2 -
    access("XWIIT"."IMAGE_CODE"(+)="MSI"."SEGMENT1")
    3 -
    access("QPPR"."PRODUCT_ATTR_VALUE"=TO_CHAR("MSI"."INVENTORY_ITEM_ID")
    AND
    "QPPR"."PRODUCT_UOM_CODE"="MSI"."PRIMARY_UOM_CODE")
    5 - filter(NVL("QPLL"."START_DATE_ACTIVE",TRUNC(SYSDATE@!))<=TRUNC(SYSDATE@!)
    AND
    NVL("QPLL"."END_DATE_ACTIVE",TRUNC(SYSDATE@!))>=TRUNC(SYSDATE@!))
    6 -
    access("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    filter("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    7 -
    access("QPLL"."LIST_LINE_ID"="QPPR"."LIST_LINE_ID")
    filter("QPPR"."PRODUCT_UOM_CODE" IS NOT NULL)
    8 - filter("MSI"."ENABLED_FLAG"='Y')
    9 - access("MSI"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID))
    11 -
    access("MCB"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID)
    AND
    "MSI"."INVENTORY_ITEM_ID"="MCB"."INVENTORY_ITEM_ID"
    AND
    "MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
           filter("MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
    Note
    - 'PLAN_TABLE' is old version
    TKprof Plan
    TKPROF: Release 11.1.0.7.0 - Production on Fri Nov 15 06:12:26 2013
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: LSSD_ora_19760.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SELECT msi.inventory_item_id,
           msi.segment1,
           primary_uom_code,
           primary_unit_of_measure,
           xwiit.image_url
      FROM mtl_system_items_b msi,
           qp_list_lines qpll,
           qp_pricing_attributes qppr,
           mtl_item_categories mcb,
           xx_web_item_image_tbl xwiit
    WHERE     msi.enabled_flag = 'Y'
           AND qpll.list_line_id = qppr.list_line_id
           AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id)
           AND qppr.product_uom_code = msi.primary_uom_code
           AND msi.inventory_item_id = mcb.inventory_item_id
           AND msi.organization_id = mcb.organization_id
           AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,
                                            TRUNC (SYSDATE))
                                   AND NVL (qpll.end_date_active,
                                            TRUNC (SYSDATE))
           AND xwiit.image_code(+) = msi.segment1
           AND msi.organization_id = :p_organization_id
           AND qpll.list_header_id = :p_price_list_id
           AND mcb.category_id = :p_category_id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        2      3.84       3.85          0     432560          0        1002
    total        6      3.84       3.85          0     432560          0        1002
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 173 
    Rows     Row Source Operation
        501  NESTED LOOPS  (cr=216280 pr=0 pw=0 time=115 us cost=9439 size=149 card=1)
       2616   HASH JOIN OUTER (cr=211012 pr=0 pw=0 time=39 us cost=9437 size=135 card=1)
      78568    HASH JOIN  (cr=210997 pr=0 pw=0 time=3786 us cost=9432 size=71 card=1)
      78571     NESTED LOOPS  (cr=29229 pr=0 pw=0 time=35533 us cost=53 size=76 card=2)
      78571      TABLE ACCESS BY INDEX ROWID QP_LIST_LINES (cr=9943 pr=0 pw=0 time=27533 us cost=49 size=44 card=2)
    226733       INDEX SKIP SCAN QP_LIST_LINES_N2 (cr=865 pr=0 pw=0 time=4122 us cost=20 size=0 card=702)(object id 99730)
      78571      INDEX RANGE SCAN QP_PRICING_ATTRIBUTES_N3 (cr=19286 pr=0 pw=0 time=0 us cost=2 size=16 card=1)(object id 99733)
    128857     TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=181768 pr=0 pw=0 time=9580 us cost=9378 size=1526382 card=46254)
    128857      INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_N9 (cr=450 pr=0 pw=0 time=1657 us cost=174 size=0 card=46254)(object id 199728)
        277    TABLE ACCESS FULL XX_WEB_ITEM_IMAGE_TBL (cr=15 pr=0 pw=0 time=22 us cost=5 size=17728 card=277)
        501   INDEX RANGE SCAN MTL_ITEM_CATEGORIES_U1 (cr=5268 pr=0 pw=0 time=0 us cost=2 size=14 card=1)(object id 99557)
    Note: I modified query and it gives good result, now it takes 3 to 4 sec for 16000 records.
    If possible can you plz explain what we have to take care while doing performance tunning
    I am a fresher so don't have that much idea.
    and also Thanks Hussein for your replay

  • Performance issue in a package

    Hi Everyone,
    I have a package that process 40000 rows and it takes 5 hours to complete. I am running the package on oracle version 11.2.0.2.0. I have also enabled a trace and below query that i found to show more time
    SQL ID: 3pkjpbwnnd2cp Plan Hash: 403651925
    SELECT REGION_ID
    FROM
    APPS.MSC_REGIONS WHERE (REGION_ID, SR_INSTANCE_ID) IN (SELECT
    E.PARENT_REGION_ID, E.SR_INSTANCE_ID FROM APPS.MSC_TRADING_PARTNER_SITES A,
    APPS.MSC_TP_SITE_ID_LID B, APPS.MSC_REGION_LOCATIONS C, APPS.MSC_REGIONS D,
    APPS.MSC_ZONE_REGIONS E WHERE A.SR_TP_SITE_ID = B.SR_TP_SITE_ID AND
    B.LOCATION_ID = C.LOCATION_ID AND B.SR_INSTANCE_ID = C.SR_INSTANCE_ID AND
    B.SR_INSTANCE_ID = D.SR_INSTANCE_ID AND B.SR_INSTANCE_ID = E.SR_INSTANCE_ID
    AND C.REGION_ID = D.REGION_ID AND C.REGION_ID = E.REGION_ID AND
    D.COUNTRY_CODE = A.COUNTRY AND A.PARTNER_TYPE = 2 AND A.TP_SITE_CODE =
    'SHIP_TO' AND A.SR_TP_SITE_ID = :B2 AND B.SR_INSTANCE_ID = :B1 ) AND
    ZONE_USAGE = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 16479 2.84 2.87 0 2376 0 0
    Fetch 16479 19431.68 19666.11 203457 53702544 114 16241
    total 32959 19434.52 19668.99 203457 53704920 114 16241
    Misses in library cache during parse: 1
    Misses in library cache during execute: 10
    Optimizer mode: ALL_ROWS
    Parsing user id: 173 (APPS) (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max) Row Source Operation
    1 1 1 VIEW VM_NWVW_2 (cr=6414697 pr=1419 pw=0 time=34240218 us cost=10 size=13 card=1)
    1 1 1 HASH UNIQUE (cr=6414697 pr=1419 pw=0 time=34240212 us cost=10 size=197 card=1)
    1 1 1 NESTED LOOPS (cr=6414697 pr=1419 pw=0 time=34239493 us)
    177 177 177 NESTED LOOPS (cr=6414524 pr=1254 pw=0 time=1091587 us cost=9 size=197 card=1)
    89 89 89 NESTED LOOPS (cr=6414370 pr=1222 pw=0 time=1011282 us cost=8 size=182 card=1)
    302963 302963 302963 NESTED LOOPS (cr=1723 pr=1201 pw=0 time=2887619 us cost=4 size=162 card=1)
    302963 302963 302963 NESTED LOOPS (cr=1684 pr=1197 pw=0 time=409650 us cost=3 size=129 card=1)
    270 270 270 NESTED LOOPS (cr=153 pr=151 pw=0 time=83922 us cost=2 size=90 card=1)
    57 57 57 PARTITION RANGE SINGLE PARTITION: KEY KEY (cr=150 pr=150 pw=0 time=60513 us cost=1 size=51 card=1)
    57 57 57 INDEX SKIP SCAN MSC_REGIONS_N2 PARTITION: KEY KEY (cr=150 pr=150 pw=0 time=60395 us cost=1 size=51 card=1)(object id 459474)
    270 270 270 PARTITION RANGE SINGLE PARTITION: KEY KEY (cr=3 pr=1 pw=0 time=23463 us cost=1 size=39 card=1)
    270 270 270 INDEX RANGE SCAN MSC_ZONE_REGIONS_N1 PARTITION: KEY KEY (cr=3 pr=1 pw=0 time=23191 us cost=1 size=39 card=1)(object id 459515)
    302963 302963 302963 PARTITION RANGE SINGLE PARTITION: KEY KEY (cr=1531 pr=1046 pw=0 time=452207 us cost=1 size=39 card=1)
    302963 302963 302963 INDEX RANGE SCAN MSC_REGION_LOCATIONS_N1 PARTITION: KEY KEY (cr=1531 pr=1046 pw=0 time=329852 us cost=1 size=39 card=1)(object id 459478)
    302963 302963 302963 PARTITION RANGE SINGLE PARTITION: KEY KEY (cr=39 pr=4 pw=0 time=2277078 us cost=1 size=33 card=1)
    302963 302963 302963 TABLE ACCESS BY LOCAL INDEX ROWID MSC_REGIONS PARTITION: KEY KEY (cr=39 pr=4 pw=0 time=1578564 us cost=1 size=33 card=1)
    302963 302963 302963 INDEX RANGE SCAN MSC_REGIONS_N2 PARTITION: KEY KEY (cr=8 pr=0 pw=0 time=929795 us cost=1 size=0 card=1)(object id 459474)
    89 89 89 TABLE ACCESS BY INDEX ROWID MSC_TRADING_PARTNER_SITES (cr=6412647 pr=21 pw=0 time=27779553 us cost=4 size=20 card=1)
    605926 605926 605926 INDEX SKIP SCAN MSC_TRADING_PARTNER_SITES_N1 (cr=5806721 pr=19 pw=0 time=14082031 us cost=4 size=0 card=1)(object id 40148)
    177 177 177 INDEX RANGE SCAN MSC_TP_SITE_ID_LID_N2 (cr=154 pr=32 pw=0 time=362449 us cost=1 size=0 card=2)(object id 328997)
    1 1 1 TABLE ACCESS BY INDEX ROWID MSC_TP_SITE_ID_LID (cr=173 pr=165 pw=0 time=2066730 us cost=1 size=15 card=1)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    1 NESTED LOOPS
    1 VIEW OF 'VW_NSO_1' (VIEW)
    1 HASH (UNIQUE)
    177 NESTED LOOPS
    89 NESTED LOOPS
    302963 NESTED LOOPS
    302963 NESTED LOOPS
    270 MERGE JOIN (CARTESIAN)
    57 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID)
    OF 'MSC_TRADING_PARTNER_SITES' (TABLE)
    57 INDEX MODE: ANALYZED (SKIP SCAN) OF
    'MSC_TRADING_PARTNER_SITES_N1' (INDEX)
    270 BUFFER (SORT)
    270 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID)
    OF 'MSC_TP_SITE_ID_LID' (TABLE)
    302963 INDEX MODE: ANALYZED (RANGE SCAN) OF
    'MSC_TP_SITE_ID_LID_U1' (INDEX (UNIQUE))
    302963 PARTITION RANGE (SINGLE) PARTITION:KEYKEY
    302963 INDEX MODE: ANALYZED (RANGE SCAN) OF
    'MSC_REGION_LOCATIONS_N2' (INDEX) PARTITION:KEYKEY
    302963 PARTITION RANGE (SINGLE) PARTITION:KEYKEY
    302963 INDEX MODE: ANALYZED (RANGE SCAN) OF
    'MSC_ZONE_REGIONS_N2' (INDEX) PARTITION:KEYKEY
    89 PARTITION RANGE (SINGLE) PARTITION:KEYKEY
    605926 INDEX MODE: ANALYZED (RANGE SCAN) OF
    'MSC_REGIONS_N2' (INDEX) PARTITION:KEYKEY
    177 TABLE ACCESS MODE: ANALYZED (BY LOCAL INDEX ROWID) OF
    'MSC_REGIONS' (TABLE) PARTITION: START=1 STOP=1
    1 PARTITION RANGE (ITERATOR) PARTITION:KEYKEY
    0 INDEX MODE: ANALYZED (RANGE SCAN) OF 'MSC_REGIONS_N2'
    (INDEX) PARTITION:KEYKEY
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    db file sequential read 203457 0.58 103.29
    Disk file operations I/O 1 0.00 0.00
    asynch descriptor resize 120 0.00 0.00
    latch: cache buffers chains 276 0.00 0.02
    latch: shared pool 12 0.00 0.00
    cr request retry 9055 0.00 0.04
    free buffer waits 9055 0.01 99.09
    resmgr:internal state change 1 0.10 0.10
    latch: object queue header operation 1 0.00 0.00
    latch: row cache objects 1 0.00 0.00
    When i execute the query separately it executes in "Elapsed: 00:00:00.03". The cost also seems fine.
    Can anyone help me on this. Thank you in advance.
    Regards,
    Raam
    Edited by: 936884 on May 26, 2012 1:22 AM
    Edited by: 936884 on May 27, 2012 11:39 PM
    Edited by: 936884 on May 27, 2012 11:53 PM
    Edited by: 936884 on May 27, 2012 11:54 PM

    Hi,
    welcome to the forum!
    1) please use tags to make your plans readable
    2) the best starting point for query tuning is execution plan with cardinality feedback enabled, please follow the link provided above in this thread for instructions
    3) explain plans are generally useless for SQL tuning. In your case, the plan you posted doesn't even match the actual plan shown in the trace file
    4) the most expensive operation in your actual plan is the INDEX SKIP SCAN of SKIP SCAN MSC_TRADING_PARTNER_SITES_N1 (or more accurately, TABLE ACCESS BY ROWID that follows this skip scan). It suggests that cardinalities are way off, but it's probably not cardinalities of  MSC_TRADING_PARTNER_SITE, but rather the cardinality of the parent operation (e.g. the cardinality of the outer rowsource in a nested loop, if the skip scan is done inside a nested lop). Since your plan is not formatted and operation ids/parent ids are are not available, I cannot say for sure.
    Best regards,
      Nikolay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Troubleshooting guide for performance issues: Note 460805.1

    Im looking for the actual performance guide. Can anybody send me the note 460805.1?
    We work with OWB 10.2. After a while, we editing some mappings, deploy something over the control centre and so on and then the performance of the client is insufficient.
    Regards,
    Bert.

    Yes, I am going to make that call Monday a.m.  to the memory company.
    Studio North wrote:
    Rowby,
    I am running 12gb of 1866 with no issues. some of the info sourced on the forums is possibly old, same as asus memory list. it goes back to 2009. 6 months old.
    best thing for people todo is call the manufacture of the memory they are interested in to make sure it will be compatible.
    Baz
    BTW, Wha'ts 1866? 

Maybe you are looking for

  • Youtube Videos do NOT play if media.mediasource.enabled is set true (Youtube with HTML 5 Player). WHY?

    I am Using the new HTML 5 Player when watching Videos on Youtube. It works just fine when media.mediasource.enabled is set to "false" but then I cannot get the full experience because the lack of features! If I enable it, NO Video is going to load, m

  • PC Card Slot

    What goes into this slot and what ever it is, what is it used for?

  • Pearl 8130 Bluetooth stop working with GPS

    Has anyone experienced a situation where your Bluetooth BlackBerry was paired with your automobile's GPS system and was working fine, then stopped one day and can't get it to pair up anymore?  We have an 8130 that was paired to the car's GPS system p

  • Im so frustrated.  Please help. Macbook has a virus

    So I downloaded a wirless samsung new camera on my Macbook and it came with a virus or something.  I had no issues with my computer until I did this.  Now it crashes on me and keeps reobooting.  I have tried to delete the camera in safemode but it wo

  • The "Printer Share" app

    Has anyone tried the Printer Share app on their Droid X? It allows you to print email, photos, docs, web pages, etc.  It's kinda expensive though at $9.99 I think it was. They do allow you to test it with a free printing of a test page just to make s