Problem with depreciation

Hello,
There are two assets that have been sold in the end of February this year.For chart of depreciation ZFI remaining values are not scrapped in area 03 when asset is sold but depreciation continues according to depreciation key, which is ZD25 in these cases (25% depreciation from net book value each year). Possible gain/loss in asset sales is taken in account as value adjustment.
For asset A it works correctly, but for asset B depreciation does not start before next year, which is incorrect. Both assets have same depr.key, only difference is that A had still value while B was already fully depreciated.
Is there some setting behind depr.key that causes assets that are fully depreciated function differently compared to assets that still have NBV?
BR,
Zulfikar

Hello,
But both the asset have the same depreciation key. I dont know why both the asset are behaving differently.
BR,
Zulfikar

Similar Messages

  • Problem with depreciation posting for an asset with a '0' net book value.

    Hi,
    I have a problem with depreciation posting on one asset. I think it should not be calculated and posted at all.
    On 1st November 2010 (our Fiscal year starts on 1st November) there was acquisition posted to an asset and then it was reversed on the same day - so the net book value was '0'.
    In AFAB depreciation run for April 2011 - it posted depreciatoion of 0.01 Euro, so now the book value is -0.01.
    Do you know how this could have happened and what can I do to get the value of this asset back to 0?
    Thank you,
    Karol

    Hi Murlidhar,
    Thank you for your reply.
    I just have one doubt - as depreciation of 0.01 Eur was posted in previous period leaving net value of asset equal to -0.01 Eur.
    Shouldn't I get ritd of this asset value before I proceed with the steps you suggested?
    I think it is not possible to reverse the depreciation - so I struggle to find a way to bring asset value back to zero.
    Thank you,
    Karol

  • Problem with depreciation area (Incorrect currency exchange rate is used)

    Good day to all SDN forumers!
    I'm having a problem with one depreciation area that we set up. The reason why we configured this depreciation area is for us to enable to monitor all asset postings in another (group) currency aside from the local currency. We set it up in such a way that the depreciation would not post and would thus only "convert" the asset postings to group currency using the table rates in table TCURR (via OB08).
    The problem is despite having defined an exchange rate for the current period, the system still picks up the exchange rate for 01/01/2001 which is incorrect. This affected all reports which displays incorrect values whenever I view the postings using the 2nd depreciation area we set up. Is there a way we can correct this?
    I'd really appreciate your comments and suggestions guys. Thanks a lot and more power!

    Update:
    I created a new depreciation area by copying an existing area and updated some of the configuration. The problem is still there though, since the depreciation area still reflects the <b>incorrect</b> rate (similar to that of the previous depreciation area) whenever I access it using Asset Explorer. What's surprising is that even though I've already set the exchange rate (e.g. USD to EUR)  to match that of the asset's capitalization / acquisition date, the posted values still do not reflect what I defined in table TCURR. Instead, it reflects the exchange rate used by the old depreciation area. Help anyone? We are already in a production client and transfer/retirement of all the assets is not an option the client would like to undertake.
    Edited by: Patrick on Nov 6, 2008 4:45 AM

  • Problem with Depreciation Run

    HI,
    while doing a depreciation user is getting prob that No value for profitability segment.
    help me out as soon as possible.

    Hi Andreas,
    thank you for your reply.
    in 46 C, the field is called Session Name (RAREP-GROUP).  Have no clue if that helps.
    What program is called when you run AFAB in 46C?
    I get RABUCH00. If you view the coding then look at line 82 (in the SAP standard version):
    BDC-Steuerung
    SELECTION-SCREEN BEGIN OF BLOCK BL5
                     WITH FRAME
                     TITLE TEXT-C02.
    PARAMETERS:
              P_GROUP LIKE <b>RAREP-GROUP </b> DEFAULT 'RABUCH',   "Gruppe
              P_HDAT  LIKE RAREP-HDAT   DEFAULT SPACE,      "Sperren bis
              P_KEEP  LIKE RAREP-KEEP   DEFAULT SPACE.      "Mappe halten
    SELECTION-SCREEN END OF BLOCK BL5.
    This coding is missing from the program used in ERP 2005 to call AFAB (RAPOST2000) thus we cannot type in a session name - which is what we use later on in SM37.
    SAP must have its reasons and I am looking forward to hearing them.
    What I am looking for is a workaround to the issue so that we can still run our testing before posting.
    Ryan

  • Problem with depreciation AFAB

    Hi,
    Asset Explorer shows a status of an asset planned depreciation 400,000 u20AC in the period 14/2009.
    Now when I do test-run depreciation (AFAB), I get the message "depreciation run has already been done for the period 14/2009".
    How can it be possible??? Can anybody help me???
    Thanks

    Hi,
    Check in table TABA that depreciation is posted upto which period for the respective company code. If you want to post delta depreciation again for the same period for which depreciation has already been posted then use "repeat run option"
    If the depreciatio is never posted for 14/2009 then you should be able to post for that period in normal run in AFAB. For better analysis please share the long text of the error message you receive when you run AFAB.
    Regards,
    Vijay

  • Problem with computation of depreciation

    Hi SDN forumers,
    We have a concern regarding the computation of the depreciation to be posted next month. Here is the scenario.
    We capitalized an asset last October 2008 with depreciation start date 10/01/2008. We processed the depreciation run for the month of October 2008 and at this point, the depreciation posted was correct based on October's Net Book Value. Come November 2008, we made some asset adjustments via F-90 (asset acquisition) which would increase the asset's net book value and at the same time adjust the depreciation per month.
    I noticed though that the depreciation to be posted for November 2008 includes that of the unposted depreciation from October 2008 (due to the increase in Net Book Value in November). This means that the depreciation to be posted for November 2008 is significantly higher than that of December 2008. What I was expecting was that (NBV + Additions / remaining life = depreciation) and that the amount to be posted would be equal every month after the acquisition.
    Is there a way we can adjust how the system computes depreciation? Thanks and best regards to each and everyone of you.

    >
    Markus Bredel wrote:
    > Hi Patrick,
    >
    > in this case you have to check your depreciation key, I would recommend to check the documentation in the SAP Help Portal concerning keyword "depreciaiton methods". I propose to use a depreciation key which depreciates according to method "net book value over remaining useful life". I think you should consider this option and test it out.
    >
    > Regards,
    > Markus
    HI Markus,
    Thanks for your continous help. I checked our existing depreciation key being used and at the same time checked "Depreciation Methods" in the SAP Help Portal. The SAP Help Portal suggested the following:
    Straight-Line from the Book Value over Remaining Useful Life
    +Use+
    The book value of the fixed asset is distributed in uniform amounts over the remaining life. However, unlike straight-line depreciation over the total useful life, this method ensures that post-capitalization and subsequent acquisitions do not lead to an extension of expected useful life. Post-capitalization or subsequent acquisitions after the expiration of the specified expected useful life do, however, cause problems in this depreciation method. In such cases, the changeover key in the depreciation key used has to provide for another method after the expiration of the expected useful life.
    +Calculation :+
    Depreciation = net book value / remaining life
    APC: 1000
    Useful life: 10
    Net book value: 500
    Remaining useful life: 5
    Depreciation = 500 / 5 = 100
    You can represent this depreciation method in the system, for example, with a depreciation key that calculates a depreciation percentage rate from the remaining life, due to the depreciation calculation method Percentage from the useful life being set in its base method, and the Rem. life indicator being set in the multi-level method. Furthermore, the base value indicator "24" in the multi-level method ensures that the net book value is the basis for depreciation. The net book value and the remaining life are related proportionally, which results in straight-line depreciation. In the event of acquisitions after the expiration of the expected useful life, the depreciation key switches to a new phase after the planned end of useful life. The new phase is set up for straight-line/remaining life/pro rata/to zero/to end of life. As a result, these subsequent acquisitions are also depreciated completely.
    I checked our depreciation keys and the settings are the ff:
    Base Method: Percentage from the useful life
    Multi-Level Method: 001
                                 Remaining Life indicator? Yes
                                 Base Value indicator: 24
    The following settings follow that of the suggestion in the SAP Help Portal. Anything wrong with my settings? Thanks a lot for your help.

  • Problems with a session of batch input - In processing

    Hello!
    I have a problem with a depreciation posting Session (AFAB). User has stoped the process of session and now the status is 'In Processing' and we can't run it anymore...
    ¿How I can process this Session?
    I've tried to delete the session and re-run the depreciation posting, but it's not working.
    I've tried to delete in TABA table the line of this period, but it's not working.
    I've tried to suicide me, but... it's not working.
    I'll try to kill the user, I hope that It will work.
    Can you help me? Please.
    Thanks a lot!!!

    Dear Jorge,
    In SM35 analyze your session.
    If it was processed in background go to transaction SM37. Else, you can proceed in SM35 itself.
    Regards,
    Naveen.

  • Problem with TX ABUMN

    Hi:
    I have some problem with Fixed assets accounting and I need some help.
    I have two fixed assets and I need to change their value and create a new one with the addition of these values I get from these two fixed assets. T
    I think Tx. ABUMN is the right one, but I get this error:
    u201CAccount 'Acc.dep. accnt.for ordinary depreciation' could not be foundu201D
    I have checked this account and it seems to be OK.
    Questions:
    Is TX ABUMN correct for this purpose?
    How I can solve this error?
    Thanks for your help.

    Hi,
    First set your COD with OAPL.
    Then go to OAY1, select Ttype 300 and click on Spl handling of transfer posting, there for all of your dep area select check box for Tranbsfer APC only.
    This will only transfer the APC value to the new assets.
    ABUMN is the only solution to your issue.
    Thanks,
    Srinu

  • Problem with quiz results.

    Hey guys, i have a problem with a quiz that i need to do, i've been using this template: http://www.permadi.com/tutorial/flashMXQuiz/index.html
    But what i need and it doesnt include is how to put a message at the end of the game which tells you that you won or lost depending if you had at least two questions right or less than two right.
    I´ve been searching and have not found any code that i could just add to my ActionScript.
    I also have been trying with variables like this:
    if(numofQuestionsAnsweredCorrectly>=2){gotoAndPlay(3)}
    else
    {gotoAndPlay(6)}
    ..and stuff like that. I'm sorry if that's completely wrong..I'm just starting to learn.
    I hope anybody can help me with this.
    Thanks

    Page 3 of the tutorial shows you the SummaryScreen. They calculate the percent correct there:
    userScore=(numOfQuestionsAnsweredCorrectly * 100) / (numOfQuestionsAnsweredIncorrectly + numOfQuestionsAnsweredCorrectly);
    It's right there you should stick your code to change to the frame you desire. Make sure you're changing the correct clips playhead.
    Do note they're using a lot of frame labels (and they're using flash player 6 with some ancient ActionScript 1.0 coding). There's a chance this quiz won't work in the future. Even ActionScript 2.0 has been depreciated and is currently unsupported by the latest version, Flash CC. It doesn't mean the browser plugin doesn't support it but eventually it may. It's long overdue..
    For the 1.0 code though, at the point I mentioned you should be able to do it with what you have (if you want to switch the main timeline to those frames via _root.
    if (numofQuestionsAnsweredCorrectly >= 2)
              _root.gotoAndPlay(3)
    else
              _root.gotoAndPlay(6)
    If you want "some other" clip to move to that frame then add the instance name after _root, e.g. _root.myClip.gotoAndPlay(3);, etc..

  • No depreciation values with depreciation run.

    Good day from sunny South Africa.
    It happens some monthends at my client that there is no depreciation values calculated for some assets. The client then load and post 1.00 and remove and post 1.00 to the scrap value of the relevant assets and that fixes the problem. Depreciation is then calculated with the next depreciation run. What could be the problem?
    Kind regards
    Marnus

    Hi Marnus,
    sounds strange, and maybe my first impression seems a little bit too easy. But anyhow, my impression when reading this was that the current asset values were not calculated correctly. Did you do an AFAR run or recalculate the asset values with AS02 in the past?
    By posting an amount to the asset and reversing it, the posting logic triggers a new calculation of asset values implicitely.
    That could be one (simple) explanation. But as Zaid already wrote, there could be several other reasons. More info could bring more light into this problem.
    Regards,
    Markus

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

  • Problem with threads and camera.

    Hi everybody!
    I've a problem with taking snapshot.
    I would like to display a loading screen after it take snapshot ( sometimes i
    have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
    I was trying to use threads but i didn't succeed.
    I made this code:
    display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while((!performing.isShown()) && (backgroundCamera.isShown())){
                        Thread.yield();
                    notifyAll();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        this.wait();                   
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();This code is sometimes showing performing screen but sometimes no.
    I don't know why. In my opinion performing.isShown() method isn't working correctly.
    Does anyone have some idea how to use threads here?

    Hi,
    I've finally managed to work this fine.
    The code:
           Object o = new Object();
           display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while(!performing.isShown()){
                        Thread.yield();
                   synchronized(o) {
                      o.notify();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        synchronized(o) {
                           o.wait(1);
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();

  • Problem with threads hanging

    We have a problem where our application stops responding after a few days of usage. Things will for fine for a day or two, and then pretty quickly threads will start getting hung up, usually in places where they are allocating memory
    We are running WebLogic 8.1 SP2 on Sun JDK 1.4.2_04 on Solaris 8 using the alternate threading model and the -server hotspot vm. We are running pretty much the same code that we had no problems with under WebLogic 6.1 SP4 and Sun JDK 1.3.1.
    A thread dump usually shows that some or all of our execute threads are in the state "waiting for monitor entry" even though they are not currently waiting on any java locks. Here is a sample thread from the thread dump (we have ~120 threads so I don't want to post the full dump).
    =============================================================================================
    "ExecuteThread: '8' for queue: 'itgCrmWarExecutionQueue'" daemon prio=5 tid=0x005941d0 nid=0x2c waiting for monitor entry [c807f000..c807fc28]
    at java.lang.String.substring(String.java:1446)
    at java.lang.String.substring(String.java:1411)
    at weblogic.servlet.internal.ServletRequestImpl.getRelativeUri(ServletRequestImpl.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3492)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    =============================================================================================
    String.java line 1446 for this jdk allocates a new String object, and all the other threads in this state also are creating new objects or arrays, etc.
    We've done a pstack on this process when it's in this state, and the threads that are in the "waiting for monitor entry" that look like they're allocating memory are all waiting on the same lwp_mutex_lock with some allocation method that's calling into the native TwoGenerationCollectorPolicy.mem_allocate_work (see pstack output below for the same thread as in the thread dump above)
    =============================================================================================
    ----------------- lwp# 44 / thread# 44 --------------------
    ff31f364 lwp_mutex_lock (e3d70)
    fee92384 __1cNObjectMonitorGenter26MpnGThread__v_ (5000, 525c, 5000, 50dc, 4800, 4af0) + 2d8
    fee324d4 __1cSObjectSynchronizerKfast_enter6FnGHandle_pnJBasicLock_pnGThread__v_ (c807f65c, c807f7d4, 5941d0, 0, 35d654, fee328ec) + 68
    fee32954 __1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_ (c807f7d4, ff170000, d4680000, 4491d4, fee1bc2c,
    0) + 78
    fee3167c __1cPVM_GC_OperationNdoit_prologue6M_i_ (c807f7bc, 4400, ff170000, 2d2b8, 4a6268, c807fa18) + 38
    fee2e0b0 __1cIVMThreadHexecute6FpnMVM_Operation__v_ (c807f7bc, 963a8, 0, 0, 1, 0) + 90
    fed2c2a4 __1cbCTwoGenerationCollectorPolicyRmem_allocate_work6MIii_pnIHeapWord__ (962c0, ff1c29ec, ff1c297c, ff131a26, 4800, 4998) + 160
    fed22940 __1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__ (ee009020, 5941d0, 15ca581, 3647f0, 4a6268, c807f8c8) + 180
    fed34928 __1cLOptoRuntimeFnew_C6FpnMklassOopDesc_pnKJavaThread__v_ (ee009018, 5941d0, 0, 0, 0, 0) + 28
    fa435a58 ???????? (ee009018, e86de, 15ca4de, 50dc, 5941d0, c807f9c8)
    fb36f9a4 ???????? (0, d412ccd8, ee046c28, ff170000, 0, 0)
    fad8b278 ???????? (ee046c28, d6000c90, ee046530, 8, db8e8450, c807f9e8)
    fad62abc ???????? (d412ccd8, ee046530, d6000c90, ee3bfa38, 8, c807fa18)
    fa4b3c38 ???????? (c807fb9c, 0, f2134700, fa415e50, 8, c807faa8)
    fa40010c ???????? (c807fc28, c807fe90, a, ee9e1e20, 4, c807fb40)
    fed5d48c __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ (c807fe88, c807fcf0, c807fda8, 5941d0, 5941d0, c807fd00) + 27c
    fee4b784 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ (ff170000, 594778, c807fd9c, c807fd98, c807fda8, 5941d0) + 164
    fee5e8dc __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ (c807fe88, c807fe84, c807fe7c, c807fe74, c807fe6c, 5941d0) + 6c
    fee6fc74 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (5941d0, 5941d0, 838588, 594778, 306d10, fee69254) + 128
    fee6927c __1cKJavaThreadDrun6M_v_ (5941d0, 2c, 40, 0, 40, 0) + 284
    fee6575c _start   (5941d0, fa1a1600, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Also when it's having this problem, the "VM Thread" is always using a lot of processor time. We did a couple of pstacks today while it was having this problem, and this thread was stuck in the ONMethodSweeper.sweep for over 15 minutes when we finally killed the server.
    From the thread dump:
    "VM Thread" prio=5 tid=0x000e2d20 nid=0x2 runnable
    From the first pstack:
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed40c04 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (42a2f4, fa5fa46d, ffffffff, fc4ffcb8, 42a2f4, 42a324) + 124
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (42a2f0, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (fa5f7f88, fa608940, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Second pstack
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed41180 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (0, ff1b9664, ffffffff, fc4ffcb8, a6f2cc, fc4ffbd0) + 6a0
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (a6f2c8, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (faded4c8, fadf2c80, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Has anyone ever seen anything like this? I'm trying to figure out if this is caused by something we're doing, or something relating to our environment and jvm options. Any ideas?

    Thanks for the reply - I'm testing our app with the +UseConcMarkSweepGC now in our test environment to make sure it doesn't cause any problems there.  Unfortunately the only place we've had this problem is on the production server, so it's extra difficult debugging this. 
    We're using the following memory options:
    -ms512m -mx512m -XX:NewSize=128m -XX:PermSize=192m -XX:MaxNewSize=128m -XX:MaxPermSize=192m -XX:SurvivorRatio=8and the following debugging options, as we've also been seeing OutOfMemoryErrors ( see http://forum.java.sun.com/thread.jsp?forum=37&thread=522354&tstart=45&trange=15 )
    -verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGCBTW, which c++filt version and options are you using? Our Solaris boxes only seem to have the GNU version installed. I was trying to run that on some of the other stack traces and wasn't getting anywhere, and didn't know if because it was GNU version wouldn't work on something compiled with the Sun compiler.
    Thanks!
    --Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Downloads from iTunes are not going into my library

    When I download songs and podcasts from iTunes on my iPhone they seem to download fine but they do not go into my library. Any ideas? All software is up to date.

  • Reporting on PL/SQL module dependencies

    Hi, I've just reverse-engineered a database into Designer 10g. The database contains 30+ packages and assorted other stored PL/SQL code modules (functions, procedures & triggers). I have used the Dependency Manager to build a list of dependencies for

  • Is the iphone 4S bought in US compatible to use in Singapore

    Hi,      I have this URGENT question as i would like to purchase the lastest Iphone 4S but i do not know whether it is compatible to use in Singapore.Thank You for your help. Regards, Leong

  • Is it possible conversion DataSource to byte[ ] ?

    Hello to all.... I�m a Student, and I can understand JMF, but I have this question. Sorry about my english, but I only need a few things.... 1. is it possible to convert a DataSource to byte[ ] ??, I need the DataSource in bytes. In other words the b

  • It's possible install Printer HP m1132 MFP in Arch?

    Hello, I try 1000 methods for install this printer.. with hplipopensource.com drivers, with official repositories drivers (hplip) and, hplip-plugin of AUR, but i cant conf this printer... any idea?? Greetings and thanks!