Slow execution, flickering graphics, and too many threads, oh my!

i wrote a little game called Aim, Fire! just to screw around.
its immense complexity involves shooting little targets that fly across the screen.
you can see it at http://www.brianmaissy.com/applets/aimfire
i made a class representing a target that paints itself and is its own thread.
its kinda nifty in a OOP sort of way: all i have to do is instantiate a target; and it takes care of the rest, notifying the driver program of anything important (like it getting shot)
the problem, however, is the speed changes significantly depending on how many targets are active, and the graphics are very flickery.
i think the problem may be that having multiple threads is slow.
i also tried buffering my graphics but it didnt work very well.
however that may just be because i did it wrong.
in fact i probably did a lot of things wrong - please notify me of anything you see that i did badly
so tell me what you think about the design of the program, and any suggestions you have to restructure it. would i do better just to stick everything in one thread, or even all in one class?
thanks very much!
here is the code: (also found at http://www.brianmaissy.com/applets/aimfire/aimFire/AimFire.java and http://www.brianmaissy.com/applets/aimfire/aimFire/Target.java)
package aimFire;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Event;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Random;
public class AimFire extends Applet{
     public static final int SPEED_CONSTANT = 500;
     public static final int MIN_X = 0;
     public static final int MIN_Y = 21;
     public static final int MAX_X = 399;
     public static final int MAX_Y = 399;
     Image ammoImage;
     private Random rand;
     private static final int CLIP = 10;
     private static final int TOTAL_TARGETS = 20;
     private int toBeAdded;
     private ArrayList<Target> targets;
     private int targetsKilled;
     private int ammo;
     private int score;
     private boolean gameActive;
     public void init(){
          setSize(400, 400);
          setBackground(Color.black);
        setCursor(getToolkit().createCustomCursor(getImage(this.getClass().getResource("crosshair.gif")), new Point(16, 16), "crosshair"));
        ammoImage = getImage(this.getClass().getResource("ammo.gif"));
        rand = new Random();
        ammo = CLIP;
        score = 0;
        gameActive = true;
        targetsKilled = 0;
        toBeAdded = TOTAL_TARGETS;
        targets = new ArrayList<Target>();
        sendRandom();
        sendRandom();
     public boolean mouseDown(Event e, int x, int y){
          if(gameActive && ammo > 0){
               ammo--;
               for(int count = 0; count < targets.size(); count++){
                    score += targets.get(count).hit(x, y);
               repaint();
          return true;
     public boolean keyDown(Event e, int key){
          if((char)key == ' ' && gameActive){
               ammo = CLIP;
               repaint();
          return true;
     private void sendRandom(){
        toBeAdded--;
          Target t = new Target(this, getGraphics(), rand);
          targets.add(t);
        new Thread(t).start();
        repaint();
     public void notifyOfDeath(Target t){
          targetsKilled++;
          targets.remove(t);
          if(toBeAdded > 0){
               sendRandom();
          if(targets.size()==0){
               gameActive = false;
          repaint();
     public void paint(Graphics g){
          g.setColor(Color.gray);
        g.drawLine(0, 20, 399, 20);
          for(int count = 0; count < ammo; count++){
               g.drawImage(ammoImage, count*10 + 3, 3, this);
          if(ammo == 0){
               g.drawString("press space to reload", 3, 13);
        g.drawString("Targets: " + targetsKilled + "/" + TOTAL_TARGETS, 230, 13);
        g.drawString("Score: " + score, 340, 13);
          if(!gameActive){
               g.setColor(Color.gray);
               g.drawString("Game Over", 170, 200);
               g.drawString("Score: " + score, 170, 230);
package aimFire;
import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;
public class Target implements Runnable{
     private AimFire a;
     private Graphics g;
     private int radius;
     private int xLocation;
     private int yLocation;
     private int xDirection;
     private int yDirection;
     private int xSpeed;
     private int ySpeed;
     public Target(AimFire driver, Graphics graphics, Random rand){
          this(driver, graphics, 3*(rand.nextInt(9)+ 2), rand.nextInt(1 + AimFire.MAX_X - 60) + 30 + AimFire.MIN_X, rand.nextInt(1 + AimFire.MAX_Y - 60 - AimFire.MIN_Y) + 30 + AimFire.MIN_Y, rand.nextInt(3)-1, rand.nextInt(3)-1, rand.nextInt(5)+1, rand.nextInt(5)+1);
          if(xDirection == 0 && yDirection == 0){
               if(rand.nextInt(2)==0){
                    if(rand.nextInt(2)==0){
                         xDirection = 1;
                    }else{
                         xDirection = -1;
               }else{
                    if(rand.nextInt(2)==0){
                         yDirection = 1;
                    }else{
                         yDirection = -1;
     public Target(AimFire driver, Graphics graphics, int r, int x, int y, int xDir, int yDir, int xSp, int ySp){
          a = driver;
          g = graphics;
          radius = r;
          xLocation = x;
          yLocation = y;
          xDirection = xDir;
          yDirection = yDir;
          xSpeed = xSp;
          ySpeed = ySp;
     public void run() {
          if(g!=null){
               paint();
               int count = 1;
               while(xLocation >= AimFire.MIN_X && xLocation <= AimFire.MAX_X && yLocation >= AimFire.MIN_Y && yLocation <= AimFire.MAX_Y){
                    unpaint();
                    if(count % (AimFire.SPEED_CONSTANT/xSpeed) == 0){
                         xLocation += xDirection;
                    if(count % (AimFire.SPEED_CONSTANT/ySpeed) == 0){
                         yLocation += yDirection;
                    paint();
                    count++;
               unpaint();
               a.notifyOfDeath(this);
     public int hit(int x, int y){
          if(Math.abs(x - xLocation) < radius/3 && Math.abs(y - yLocation) < radius/3){
               xLocation = -99;
               return 3;
          }else if(Math.abs(x - xLocation) < 2*radius/3 && Math.abs(y - yLocation) < 2*radius/3){
               xLocation = -99;
               return 2;
          }else if(Math.abs(x - xLocation) < radius && Math.abs(y - yLocation) < radius){
               xLocation = -99;
               return 1;
          }else{
               return 0;
     private void paint(){
          g.setColor(Color.red);
          g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
          g.setColor(Color.white);
          g.fillOval(xLocation-2*radius/3, yLocation-2*radius/3, 4*radius/3, 4*radius/3);
          g.setColor(Color.red);
          g.fillOval(xLocation-radius/3, yLocation-radius/3, 2*radius/3, 2*radius/3);
     private void unpaint(){
          g.setColor(Color.black);
          g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
}

i wrote a little game called Aim, Fire! just to screw around.
its immense complexity involves shooting little targets that fly across the screen.
you can see it at http://www.brianmaissy.com/applets/aimfire
i made a class representing a target that paints itself and is its own thread.
its kinda nifty in a OOP sort of way: all i have to do is instantiate a target; and it takes care of the rest, notifying the driver program of anything important (like it getting shot)
the problem, however, is the speed changes significantly depending on how many targets are active, and the graphics are very flickery.
i think the problem may be that having multiple threads is slow.
i also tried buffering my graphics but it didnt work very well.
however that may just be because i did it wrong.
in fact i probably did a lot of things wrong - please notify me of anything you see that i did badly
so tell me what you think about the design of the program, and any suggestions you have to restructure it. would i do better just to stick everything in one thread, or even all in one class?
thanks very much!
here is the code: (also found at http://www.brianmaissy.com/applets/aimfire/aimFire/AimFire.java and http://www.brianmaissy.com/applets/aimfire/aimFire/Target.java)
package aimFire;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Event;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Random;
public class AimFire extends Applet{
     public static final int SPEED_CONSTANT = 500;
     public static final int MIN_X = 0;
     public static final int MIN_Y = 21;
     public static final int MAX_X = 399;
     public static final int MAX_Y = 399;
     Image ammoImage;
     private Random rand;
     private static final int CLIP = 10;
     private static final int TOTAL_TARGETS = 20;
     private int toBeAdded;
     private ArrayList<Target> targets;
     private int targetsKilled;
     private int ammo;
     private int score;
     private boolean gameActive;
     public void init(){
          setSize(400, 400);
          setBackground(Color.black);
        setCursor(getToolkit().createCustomCursor(getImage(this.getClass().getResource("crosshair.gif")), new Point(16, 16), "crosshair"));
        ammoImage = getImage(this.getClass().getResource("ammo.gif"));
        rand = new Random();
        ammo = CLIP;
        score = 0;
        gameActive = true;
        targetsKilled = 0;
        toBeAdded = TOTAL_TARGETS;
        targets = new ArrayList<Target>();
        sendRandom();
        sendRandom();
     public boolean mouseDown(Event e, int x, int y){
          if(gameActive && ammo > 0){
               ammo--;
               for(int count = 0; count < targets.size(); count++){
                    score += targets.get(count).hit(x, y);
               repaint();
          return true;
     public boolean keyDown(Event e, int key){
          if((char)key == ' ' && gameActive){
               ammo = CLIP;
               repaint();
          return true;
     private void sendRandom(){
        toBeAdded--;
          Target t = new Target(this, getGraphics(), rand);
          targets.add(t);
        new Thread(t).start();
        repaint();
     public void notifyOfDeath(Target t){
          targetsKilled++;
          targets.remove(t);
          if(toBeAdded > 0){
               sendRandom();
          if(targets.size()==0){
               gameActive = false;
          repaint();
     public void paint(Graphics g){
          g.setColor(Color.gray);
        g.drawLine(0, 20, 399, 20);
          for(int count = 0; count < ammo; count++){
               g.drawImage(ammoImage, count*10 + 3, 3, this);
          if(ammo == 0){
               g.drawString("press space to reload", 3, 13);
        g.drawString("Targets: " + targetsKilled + "/" + TOTAL_TARGETS, 230, 13);
        g.drawString("Score: " + score, 340, 13);
          if(!gameActive){
               g.setColor(Color.gray);
               g.drawString("Game Over", 170, 200);
               g.drawString("Score: " + score, 170, 230);
package aimFire;
import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;
public class Target implements Runnable{
     private AimFire a;
     private Graphics g;
     private int radius;
     private int xLocation;
     private int yLocation;
     private int xDirection;
     private int yDirection;
     private int xSpeed;
     private int ySpeed;
     public Target(AimFire driver, Graphics graphics, Random rand){
          this(driver, graphics, 3*(rand.nextInt(9)+ 2), rand.nextInt(1 + AimFire.MAX_X - 60) + 30 + AimFire.MIN_X, rand.nextInt(1 + AimFire.MAX_Y - 60 - AimFire.MIN_Y) + 30 + AimFire.MIN_Y, rand.nextInt(3)-1, rand.nextInt(3)-1, rand.nextInt(5)+1, rand.nextInt(5)+1);
          if(xDirection == 0 && yDirection == 0){
               if(rand.nextInt(2)==0){
                    if(rand.nextInt(2)==0){
                         xDirection = 1;
                    }else{
                         xDirection = -1;
               }else{
                    if(rand.nextInt(2)==0){
                         yDirection = 1;
                    }else{
                         yDirection = -1;
     public Target(AimFire driver, Graphics graphics, int r, int x, int y, int xDir, int yDir, int xSp, int ySp){
          a = driver;
          g = graphics;
          radius = r;
          xLocation = x;
          yLocation = y;
          xDirection = xDir;
          yDirection = yDir;
          xSpeed = xSp;
          ySpeed = ySp;
     public void run() {
          if(g!=null){
               paint();
               int count = 1;
               while(xLocation >= AimFire.MIN_X && xLocation <= AimFire.MAX_X && yLocation >= AimFire.MIN_Y && yLocation <= AimFire.MAX_Y){
                    unpaint();
                    if(count % (AimFire.SPEED_CONSTANT/xSpeed) == 0){
                         xLocation += xDirection;
                    if(count % (AimFire.SPEED_CONSTANT/ySpeed) == 0){
                         yLocation += yDirection;
                    paint();
                    count++;
               unpaint();
               a.notifyOfDeath(this);
     public int hit(int x, int y){
          if(Math.abs(x - xLocation) < radius/3 && Math.abs(y - yLocation) < radius/3){
               xLocation = -99;
               return 3;
          }else if(Math.abs(x - xLocation) < 2*radius/3 && Math.abs(y - yLocation) < 2*radius/3){
               xLocation = -99;
               return 2;
          }else if(Math.abs(x - xLocation) < radius && Math.abs(y - yLocation) < radius){
               xLocation = -99;
               return 1;
          }else{
               return 0;
     private void paint(){
          g.setColor(Color.red);
          g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
          g.setColor(Color.white);
          g.fillOval(xLocation-2*radius/3, yLocation-2*radius/3, 4*radius/3, 4*radius/3);
          g.setColor(Color.red);
          g.fillOval(xLocation-radius/3, yLocation-radius/3, 2*radius/3, 2*radius/3);
     private void unpaint(){
          g.setColor(Color.black);
          g.fillOval(xLocation-radius, yLocation-radius, 2*radius, 2*radius);
}

Similar Messages

  • Too many threads?

    Is there a such thing as using too many threads? I'm in the planning stages and it would be nice to have each object running on its own thread, but is this a horrible thing? Is there a general rule of thumb on the number of running threads?

    Personally, I think if you have more than 20 or so
    threads in a process, the task swiching time will
    start to exceed the useful work done. Its better to
    use one of the standard patterns for pooling threads.There is no one 'right' or 'maximum' number of threads.
    The number of threads after which things get overly inefficient varies greatly depending on the characteristics of the application. If 20 threads fully consume the CPU, then adding more threads will only make things worse. If 20 threads can only use 10% of the CPU resources because of external delays (network access, database, etc.) then it may be true that using 200 threads is best, assuming of course that the throughput capacity of the network, database or external system can accomidate the increased load.
    What you'd like to avoid is preemption - a runnable thread interrupts a currently running thread that still has need of the CPU - this wastes time. If the running threads tend to block before the end of their time slice, then there really isn't going to be any added cost to context switches, nothing else would be using the CPU anyway.
    If the computer the application is running on has a number of CPU's, then it can probably accomidate more threads than a single CPU system. Of course there are limits to the effectiveness of this and a single process with many threads may not (often does not) run as efectively as several copies of the application with fewer threads each due to various inter thread contention issues.
    Chuck

  • Slow system and too many details after upgrading to OS/Lion

    This MacBook Pro is my right hand, I was doing so great with Snow Leopard, Now everything takes twice longer. I cleaned up, reseted, reinstalled softwares, etc. same.
    Too many details that doesn't work correctly.
    -Safari constantly needs to be loading. Some times Firefox.
         The track pad cant keep open a display box with a long list, once you try to scroll down.
    -Preview, i used this app a lot, safe me time, DUPLICATE? instead of SAVE, i don't see the purpose. After editing images and safe them, gamma, color patterns and light appear distortion.
    -iTunes volume doesn't comeback after using Skype or another app, remains low.
    -Airport takes a bit longer to find a local network.
    -There is not an extra space for the left and right scroll bottom on the finder window, sometimes this one disappear but mostly remains which makes it pretty tricky to open the last file at the bottom of the list. because the scroller is on front.
    -External Drives, takes longer to connect or disconnect them.
    Suggestions before i reinstall Snow Leopard.

    guizz,
    it sounds like you have come across the mother of all problems but i would like to help as much as i can.
    first of all, i noticed that it took a few days after installing lion before my system was back to the full stride it had while running snow leopard give it some time and a few updates and lion should speed up because components such as ram take time to adjust.
    the duplicate thing in preview is a new thing that came out with versions, one of the many new features in lion. i think it takes the place of the SAVE AS... command and you should still be able to save using the old command-s keystroke however part of lion includes an autosave feature so you really never have to worry about saving your work.
    i personally cannot speak for safari or firefox even though i have both because i use google chrome as my web browser you can always give that a try.
    in the system preferences under the general settings option you can change how the scroll bar is displayed on the screen.
    i would suggest searching for other people who have had similar problems with itunes to try and find an answer
    as for everything else your system may just need time to adjust to lion
    good luck hope this helped a little

  • Thread Count Queue Length in Negative and Too many standby Thread

    We are using Weblogic server 9.2.2 with 1 admin server and 4 managed server . Currently in one of the servers I could observe that there are around 77 standby threads.
    Home > Summary of Servers > server1 > Monitoring > Threads > Self-Tuning Thread Pool
    I could see that the "queue length" is negative (-138) and self tuning standby thread count is 77. Large number of threads STANDBY thread persists during the busy time of the business hours where as other servers are fully utilized.
    Is it normal to have negative queue length and so many STANDBY threads? As for JMS queue negative oracle had already acknowledged that it is a bug. Thanks.
    Edited by: 855849 on May 1, 2011 7:19 AM
    Edited by: SilverHawk on May 12, 2011 8:12 AM

    Yesterday an Oracle Consultant acknowlegded that it is a bug. There was a patch issued for Negative count in the JMS queue count and now this. Thanks for the reply by the way.

  • ROWTYPE and "Too many values" error...

    I'm in the middle of trying to understand the inner workings of %ROWTYPE and how I can copy the structure of a table with it. I think I'm understanding the gist of it, but I continue to fail in pinpointing the actual values I try to insert with an example tutorial I'm using at the moment and was hoping someone could help me understand my problem better so that I can bridge this mental gap I seem to be slipping into...
    That said, I have the following table: ct_employee
    The columns of this table (and their schema settings) are as follows:
    empno - NUMBER(4,0)
    ename - VARCHAR2(20)
    job - VARCHAR2(20)
    mgr - NUMBER(4,0)
    hiredate - DATE
    sal - NUMBER(7,2)
    comm - NUMBER(7,2)
    ct_department - NUMBER(2,0)The SQL I'm using in all this is the following:
    SET VERIFY OFF
    DEFINE emp_num = 7369;
    DECLARE
      emp_rec ct_retired_emps%ROWTYPE;
    BEGIN
      SELECT *
      INTO emp_rec
      FROM ct_employee
      WHERE empno = &emp_num;
      emp_rec.leavedate := SYSDATE;
      UPDATE ct_retired_emps SET ROW = emp_rec
      WHERE empno = &emp_num;
    END;As I hope you can tell from the above, I'm trying to create a variable (emp_rec) to store the structure of ct_employee where upon I then copy a record into emp_rec if and only if the empno column from ct_employee matches that of the emp_num "7369".
    I'm using SQL*PLUS with 10g in all this (+a program I love, by the way; it's really easy to use and very informative+) and when I press the "Run Script" button, I receive the following Script Output:
    Error report:
    ORA-06550: line 6, column 3:PL/SQL: ORA-00913: too many values
    ORA-06550: line 4, column 3:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:>
    What I translate from this is that there's either a column number mismatch or else there's some value being attempted to be inserted into the variable I created that isn't matching the structure of the variable.
    Anyway, if someone around here could help me with this, you would make my day.

    It's still not updating the table. :(
    Here's where I am...
    I currently have the following pl/sql:
    SET VERIFY OFF
    DEFINE emp_num = 7369;
    DECLARE
      emp_rec ct_retired_emps%ROWTYPE;
    BEGIN
      SELECT *
      INTO emp_rec
      FROM ct_employee
      WHERE empno = &emp_num;
      emp_rec.leavedate := SYSDATE;
      UPDATE ct_retired_emps SET ROW = emp_rec
      WHERE empno = &emp_num;
    END;I'm trying to avoid as much hard-coding as possible, hence my use of the all selector, but because of this, SQL*Plus is now giving me a run-time error of the following:
    Error report:ORA-06550: line 6, column 3:
    PL/SQL: ORA-00913: too many values
    ORA-06550: line 4, column 3:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:>
    So to remedy this, I then try the following revised PL/SQL:
    SET VERIFY OFFDEFINE emp_num = 7369;
    DECLARE
    emp_rec ct_retired_emps%ROWTYPE;
    BEGIN
    SELECT empno, ename, job, mgr, hiredate, SYSDATE as leavdate, sal, comm, ct_department
    INTO emp_rec
    FROM ct_employee
    WHERE empno = &emp_num;
    UPDATE ct_retired_emps SET ROW = emp_rec
    WHERE empno = &emp_num;
    END;>
    This time, everything runs smoothly, however, no information is updated into the ct_retired_emps! Ha!
    I've verified that there's a record in ct_employee that has "7369" for its empno column value, so there should be no missing value concern from all this. The only other thing I can think of is that there must be something askew with my logic, but as to what, I have no clue. Below are my columns for both tables:
    ct_employee -
    empno, ename, job, mgr, hiredate, sal, comm, ct_department
    ct_retired_emps -
    empno, ename, job, mgr, hiredate, leavedate, sal, comm, deptno
    My immediate questions:
    1.) I know nothing about debugging or troubleshooting PL/SQL, but I do know that I need to review the contents of the emp_rec variable above to see what all is inside it so that I can better assess what's going on here. I've tried to use DBMS_OUTPUT.PUT_LINE(emp_rec) but this does nothing and only creates another run-time error. What's a way in which I can output the contents of this regardless of run-time success? Would I need to code in an EXCEPTION section and THEN use DBMS_OUTPUT...?
    2.) SELECTING * in the first snippet above meant that I was disallowed the use of the emp_rec.leavedate := SYSDATE; after the SELECT. How might oneself SELECT * AND+ use emp_rec.leavedate := SYSDATE; in the same EXECUTION section?
    3.) With everything I've provided here, do you see any obvious issues?
    It doesn't take a genius to realize I'm new at this stuff, but I am trying to provide everything I can to learn here so if any of you can help this poor guy out, he'd be very grateful.

  • How do I stop unwanted and too many friend request...

    I started receiving way too many contact requests from unknown men, usually all military, Which I have been consistently blocking, but I want to know if my account has been jacked or what is going on and how to stop this, please. Anyone???

    just some clarifications changing your privacy settings will only prevent unwanted calls and/or IMs from people who are not in your contact list.  It will not prevent other users, both legitimate and potential scammers/spammers, from sending your contact requests.
    IF YOU FOUND OUR POST USEFUL THEN PLEASE GIVE "KUDOS". IF IT HELPED TO FIX YOUR ISSUE PLEASE MARK IT AS A "SOLUTION" TO HELP OTHERS. THANKS!
    ALTERNATIVE SKYPE DOWNLOAD LINKS | HOW TO RECORD SKYPE VIDEO CALLS | HOW TO HANDLE SUSPICIOS CALLS AND MESSAGES
    SEE MORE TIPS, TRICKS, TUTORIALS AND UPDATES in
    | skypefordummies.blogspot.com | 

  • System I/O and Too Many Archive Logs

    Hi all,
    This is frustrating me. Our production database began to produce too many archived redo logs instantly --again. This happened before; two months ago our database was producing too many archive logs; just then we began get async i/o errors, we consulted a DBA and he restarted the database server telling us that it was caused by the system(???).
    But after this restart the amount of archive logs decreased drastically. I was deleting the logs by hand(350 gb DB 300 gb arch area) and after this the archive logs never exceeded 10% of the 300gb archive area. Right now the logs are increasing 1%(3 GB) per 7-8 mins which is too many.
    I checked from Enterprise Manager, System I/O graph is continous and the details show processes like ARC0, ARC1, LGWR(log file sequential read, db file parallel write are the most active ones) . Also Phsycal Reads are very inconsistent and can exceed 30000 KB at times. Undo tablespace is full nearly all of the time causing ORA-01555.
    The above symptoms have all began today. The database is closed at 3:00 am to take offline backup and opened at 6:00 am everyday.
    Nothing has changed on the database(9.2.0.8), applications(11.5.10.2) or OS(AIX 5.3).
    What is the reason of this most senseless behaviour? Please help me.
    Thanks in advance.
    Regards.
    Burak

    Selam Burak,
    High number of archive logs are being created because you may have massive redo creation on your database. Do you have an application that updates, deletes or inserts into any kind of table?
    What is written in the alert.log file?
    Do you have the undo tablespace with the guarentee retention option btw?
    Have you ever checked the log file switch sequency map?
    Please use below SQL to detirme the switch frequency;
    SELECT * FROM (
    SELECT * FROM (
    SELECT   TO_CHAR(FIRST_TIME, 'DD/MM') AS "DAY"
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '00', 1, 0)), '999') "00:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '01', 1, 0)), '999') "01:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '02', 1, 0)), '999') "02:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '03', 1, 0)), '999') "03:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '04', 1, 0)), '999') "04:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '05', 1, 0)), '999') "05:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '06', 1, 0)), '999') "06:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '07', 1, 0)), '999') "07:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '08', 1, 0)), '999') "08:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '09', 1, 0)), '999') "09:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '10', 1, 0)), '999') "10:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '11', 1, 0)), '999') "11:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '12', 1, 0)), '999') "12:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '13', 1, 0)), '999') "13:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '14', 1, 0)), '999') "14:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '15', 1, 0)), '999') "15:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '16', 1, 0)), '999') "16:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '17', 1, 0)), '999') "17:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '18', 1, 0)), '999') "18:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '19', 1, 0)), '999') "19:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '20', 1, 0)), '999') "20:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '21', 1, 0)), '999') "21:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '22', 1, 0)), '999') "22:00"+
    +, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '23', 1, 0)), '999') "23:00"+
    FROM V$LOG_HISTORY
    WHERE extract(year FROM FIRST_TIME) = extract(year FROM sysdate)
    GROUP BY TO_CHAR(FIRST_TIME, 'DD/MM')
    +) ORDER BY TO_DATE(extract(year FROM sysdate) || DAY, 'YYYY DD/MM') DESC+
    +) WHERE ROWNUM < 8+
    Ogan

  • I need help!  I installed icloud on my computer, uploaded photos, my computer crashed and now my ipad runs slow b/c there are too many photos.  Is there a way to delete photos from my ipad (right now, I can click on the photos but not delete)?

    What options do I have?  Will purchasing more storage help?  Can I change control from my PC to my ipad if I can't use my computer anymore?

    You can import your photos and videos in the Camera Roll on your iPad to your work computer using you usb cable, then delete them from your iPad by following the directions here: http://support.apple.com/kb/HT4083.  If you also have photo stream photos that are not in your camera roll that you want to save, save them to your camera roll so they can be imported too.  To do this, open your My Photo Stream album, tap Edit, tap the photos, tap Share, tap Save to Camera Roll.  After importing them you can delete them from your iPad if you want by tapping Edit again, tapping the photos, then tapping Delete.
    Once they are on your work computer, you can transfer them to a USB memory stick if you cannot leave them there.
    Any photos on your iPad that were synced from your computer can be salvaged by using an app like PhotoSync to transfer them to your work computer over wifi.  (They can't be saved to the camera roll and imported with your usb cable like photos in the camera roll.)  Deleting these photos from your iPad will require using iTunes.  Once you have your own computer again and can install iTunes, you can delete these remaining photos by creating an empty folder on your computer, then selecting this folder to sync to your iPad on the Photos tab of your iTunes sync settings and syncing.

  • IMac 21" late 09: Slow, screen flickering/tearing and odd behavior - the problem that puzzles everyone

    PLEASE HELP!
    My iMac 21" late -09, started acting a bit wierd a year ago. Things got worse rapidly, it got slower, the screen flickers/tears (see link below), short moments of lost internet connection, lost connection whit the keyboard (might be keyboard that is broken), almost overheats when gaming and odd behavior on some webbsites whit galleries and/or videos.
    Let's begin whit the screen: it's not vertikal lines or major distortions, just a subtle horisontal line that "wanders" from bottom to topp and some lagging from time to time. Looks like this: http://cl.ly/3i2W2o3S1D2T
    The wierd thing is that hi-res does not mean more "tearing". Yes the lagg and risk of tearing increases, but the connection seems to be: lots of movement=tearing. So a pixeld 240p video of people dancing can be way worse than a news debbate in1080p!?!
    Lost connection whit internet and keyboard rarely happens and is probably due to something else, but thought that was good to have in mind.
    Odd behavior: galleries ex: when browsing images on Facebook in fullscreen, the image sometimes jumps around in the beginning and when clicking on next the same picture might appear again or just nothing at all. When scrolling down overwiewing a gallery, the updating stops and you can't scroll down further. This problem appers mainly on FB, deviantart also acts a bit wierd but there is often small issues whit image sites. Doesn't help to switch browsers either!
    Videos: Youtube is horrible to use, stops loading, dosen't start loading, erases everything loaded (grey bar disapears and reloads), refuse to switch ressolution and suddenly stops the video like it was done! "ehh.. wasn't this 2min long? Not anymore, now its 34sec!". Mainly a Youtube problem but many similar sites can be a bit problematic to use.
    NO, it's not the HTML-5 problem or any standard flash issue and using a different browser dosen't help!
    Worst is the fact that most of these errors are not constant! One day your watching youtube or mabey a movie in VLC, a bit laggy, but almost no problem. Next day **** brakes lose and after 2hours of struggling you are ready to stabb yourself in the face!
    What i tried: Most easy buggfixes that might cause the above problems, updating most things, Switched from OS X SL to OS X ML, complete reinstall and some things i probably forgot by now. Then went to MacStore for repair, they didn't find anything wrong and said it worked fine after the standard diagnostic/repair program!?! Went home and everything was the same! Went a second time to MacStore, same result.
    So I'v reinstalled a few times and it seems to improve the Mac. But 2-3weeks later every error is back, even if I barely installed or downloaded anything!?!
    Any idea what this could be? Or is the graphic card broken and MacStore has a blind, inbred muppet as a technician?

    No I didn't. The first time i explained the problem thoroughly and thought that they just couldn't miss such a visual error. I was wrong. The second time the technician wasn't there so i showed the above clip to the salesstaff and explained everything onceagain. Later the technician called me and we talked for 10min.
    Btw, the problems always "manifests themselves", just varies between strenght and frequence.
    But all other issues aside, what could cause the tearing of the screen as seen int the above clip?

  • Re: Too many threads?

    It would depend on the type of application and the target platform but I would certainly agree that 20 would be plenty for the vast majority of circumstances.
    Writing a Thread pool conforming to the following interface (for example) is quite straightforward:
    public interface ThreadPool
      public void run(Runnable runnable);
    }Using a Thread pool has the added bonus that you can try using a new Thread for each Runnable or having a limited-size pool without having to change any code except the implementation of your ThreadPool.

    Now why's Jive gone and generated a new Thread for my reply as well as creating a reply too, eh? Grr.

  • IWeb, FTP and too many Macs

    I have created a site using iWeb on my MacAir with the assets uploaded to an FTP server through e-noise. I now have a iMac and would like to make changes on the machine, but every time I open iWeb it only allows me to start a new site. I'd like to be able to make changes on my iMac (at home) and on the road (MacAir). Can anyone advise me on how I might go about this please.
    Many thanks
    Kieron

    I use dropbox. I love it. It's free for up to 2GB of capacity. I'm editing my site from three different computers. It eliminates any confusion regarding which file was the last one edited, which machine it's on, etc. I keep my domain file in dropbox and keep an alias in the left sidebar of the finder window. So all I have to do to edit my site is double click the domain file alias in any finder window, no matter what computer I'm working on. The dropbox website also keeps backups of your files so in case you ever lose your work, you can retrieve a back up from DropBox.com.
    One thing you need to be careful about is to not edit your file from two different computers at the same time, The file can become corrupted if you do this.
    David

  • SQL Blocking notification - at high monitoring level and holding many threads in Sharepoint 2010

    I am getting the following error in our SharePoint 2010 environment:
    Unexpected       PortalSiteMapProvider was unable to fetch current node, request
    Account Pipeline Dashboard/EditForm.aspx, message: Thread was being aborted.
    Any ideas?
    -Kash

    There could be multiple reasons for this, one possible reason is that your application pool account does not have full permissions to read the complete site collection.
    Identify your web apps' app pool account using inetmgr
    Login to central site administration
    Go to Application management > Policy for web application
    Choose the web application where the inaccessible site collection exists
    Add a full control policy for the app pool account
    Try below command:
    $wa = Get-SPWebApplication -Identity "http://intranet.mysite.com"
    $wa.Properties["portalsuperuseraccount"] = "i:0#.w|pro1766\sp_superuser_cache" $wa.Properties["portalsuperreaderaccount"] = "i:0#.w|pro1766\sp_superreader_cache"
    $wa.Update()
    Also try below hotfix
    http://blogs.msdn.com/b/joerg_sinemus/archive/2013/02/12/february-2013-sharepoint-2010-hotfix.aspx
    If this helped you resolve your issue, please mark it Answered

  • Music playlist shows wrong cover and too many songs

    On my iPhone 4s, I just did the upgrade to iOS 7 (I did a fresh install to be sure) and I am using iTunes 11.1
    So now my playlist in the Music app is messed up.
    In iTunes, I have both: just normal playlists and playlist-folders (which themselves have playlists)
    e.g. A Folder is called "The Alan Parsons Project" and underneath there are the playlists ("I Robot", "On Air", ...)
    The problem is with this playlist folders:
    On the iPhone, the Music app shows me the right folder name, but it shows me a wrong cover. The same wrong cover for each playlist-folder!
    The playlists themselves appear with the right cover
    Any other music app (Track 8, CarTunes), that ist able to show the number of songs, shows me the folder names, each containing all my songs!
    Normal playlists are shown correctly.
    Any suggestions?

    Thank you! This was driving me crazy. I had this issue when I initially installed iOS 7. At that time I removed all my music and resynced, and then the correct art displayed. I recently had to restore my iPhone and resync, and the bug of wrong art for playlist folders came back. (Strangely, it consistently displayed the same wrong art and displayed the same wrong art as when it happened before.) I kept removing and resyncing my playlists and deleting the iTunes album art cache to no avail. The fix of renaming the folders worked!

  • Duplicates and too many formats in iTunes library

    How do I clean up my iTunes library? I have duplicates of every song now in both AAC and MPEG formats in there. I would like to delete the duplicates and all the mpeg songs leaving only the AAC songs in my library to sync with my Nano. THANKS

    Robert Jacobson has a script for removing duplicates here:
    http://home.comcast.net/~teridon73/itunesscripts/
    As for removing MPEG files, have you discovered the "kind" column. If you go to View>>View options, there is a check box to display it.
    You could either sort on the kind field or create a smart playlist where Kind is the format you want to delete.
    This will group files of the same type together, but you would have to delete them yourself.

  • UserTransaction and too many connections

    This might sound a bit weird. I am just looking for some quick pointers here if possible. The OC4J version in use is 9.0.4.0.0. I am doing something along the following lines in a struts action class.
    1) UserTransaction txn = ctx.lookup("java:comp/UserTransaction");
    2) Connection conn = dataSource.getConnection();
    3) txn.begin();
    4) ..StatelessSessionBean call which uses a few entity beans (Bean Managed)
    5) Direct updates using conn (no commits in this).
    6) txn.commit
    My issue is with step 4 above. It does some updates and this results in close to 500 plus physical db connections getting created when in UserTransaction. The beans are normal usual beans and the whole process works without issues if I get rid of UserTransaction with less than 50 physical connections.
    I am just not able to pinpoint what exactly might be going wrong in the beans that such a large number of connections get created when in UserTransaction.
    The datasource is along these lines
         &lt;data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="xxxDB"
              location="jdbc/xxxDBCore"
              pooled-location="jdbc/xxxDBCore_non_tx"
              xa-location="jdbc/xa/xxxDBXA"
              ejb-location="jdbc/xxxDB"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="xxxxxxxx"
              password="xxxxxxxx"
              url="jdbc:oracle:thin:@1.2.3.4:1521:xxx"
              min-connections="10"
         /&gt;
    I check for the number of physical connections using the oc4j option
    -Ddatasource.verbose=true which prints out the information.
    If I set the max-connections attribute on the datasource, I get a Timeout waiting for connection exception in the app.
    If any of this rings a bell and if you have any thoughts or suggestions, I would really appreciate it.
    Thanks in advance
    best regards
    -Sudhir

    Just to add to my above post, the messages on the cnsole are along the lines of ...
    null: Connection com.evermind.sql.DriverManagerXAConnection@189c9fe allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@12c820f
    null: Connection com.evermind.sql.DriverManagerXAConnection@12c820f allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@10eb09e
    null: Connection com.evermind.sql.DriverManagerXAConnection@10eb09e allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@16d7d9e
    null: Connection com.evermind.sql.DriverManagerXAConnection@16d7d9e allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@e3f9e3
    null: Connection com.evermind.sql.DriverManagerXAConnection@e3f9e3 allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@10382ca
    null: Connection com.evermind.sql.DriverManagerXAConnection@10382ca allocated (Pool size: 0)
    Created new physical connection: com.evermind.sql.DriverManagerXAConnection@17faec2
    Why would the pool size be 0?

Maybe you are looking for

  • How can I delete my Apple email account

    Hello - when Apple made the move from MobileMe to iCloud (and stopped offering web hosting) a couple of years ago I decided that wasn't for me and switched back to a PC. Never looked back. However, it seems my old .Mac email account is still active a

  • Error while creating user - not authorized to assign profiles or roles

    I have configured CUA according to the help.sap.com instructions.  I am getting this error (in TCODE SCUL).. +You are not authorized to assign profiles Message no. 01589 You are not authorized to assign profiles to users or to cancel the authorizatio

  • How do I get rid of the Genius playlist on my new ipod?

    Every post I've found on this topic says that turning Genius off in iTunes also turns off the playlist. However, I don't have Genius turned on in iTunes, so I can't turn it off. How do I get rid of the playlist?

  • How to check field values of Extractor in Extractor Checker???

    Hi Gurus,                I am looking for field values being extracted by extractor, for a given selection criterion. For that I run transaction RSA3 in debug mode. Now I am stuck. Can you please tell me the exact steps to check the field values? Ple

  • Lost iTunes Music during hard drive replacement

    had to have my hard drive deleted and reinstalled.  unable to reload the back up from external drive.  Lost all of my music ~ unable to locate in iTunes.  Is there a help line or a way to locate and reinstall missing music?  Thx!