Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:23:14+00:00 2026-06-03T09:23:14+00:00

When Proguard optimize my application, it seams that all calls to Object#wait() are being

  • 0

When Proguard optimize my application, it seams that all calls to Object#wait() are being removed.

So that each Thread which should passively wait (until notification) is now actively waiting (100% CPU usage).

When the optimizing is shutdown with -dontoptimize everything is OK.

Has I need the optimization for removing some method with -assumenosideeffects, I am searching for what’s wrong.

Is it possible to preserve all calls to Object#wait() to be optimized (removed)?

Is there any other solution?

EDIT 1:
For example this code:


@Override
public void run() {
    isRunning = true;
    try {
        while (isRunning) {
            if (parent.isActivate) {
                parent.updateDriveButtons();
                synchronized (this) {
                    wait(1000);
                }
            }
            else {
                synchronized (this) {
                    // Wait for that the page is activated.
                    Utils.wait(this);
                }
            }
        }
    }
    catch (Throwable e) {
        e.printStackTrace();
    }
    finally {
        isRunning = false;
    }
}

is being replaced by this code (after decompiling the optimized code):
wait() has been removed and only the synchronize is visible with monitorenter; … monitorexit;


 public final void run()
  {
    this.isRunning = true;
    try {
      while (this.isRunning) {
        if (this.parent.isShowing()) {
          ...
          monitorenter;
          monitorexit; continue;
        }

        monitorenter;

        monitorexit;
      }return;
    } catch (Throwable localThrowable) {
      Object Ljava/lang/Object;;
      return;
    } finally {
      this.isRunning = false; } throw localObject1;
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:23:16+00:00Added an answer on June 3, 2026 at 9:23 am

    You appear to be specifying -assumenosideeffects options that also match Object#wait(). ProGuard then happily removes those calls for you. You probably shouldn’t add -assumenosideeffects options beyond the ones that are documented in the ProGuard manual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to obfuscate my android application using proguard and ant ( eclipse +
I noticed that the template proguard.cfg always contains the following: -keep public class *
When I compile my Android Application with Proguard enabled I get the following error:
I have a project that I've been using proguard with successfully for a long
I have obfuscated my android application using Proguard on Eclipse, now I have to
Does anyone have experience in using ProGuard and are there already measurements about application
In other words: what -keep commands should I use to tell Proguard to avoid
I have two versions of the same application using identical proguard.cfg with the following
I have a Guice enabled application working fine, but when I optimize it (i.e.,
I have an applet, which I was writing in Java. Recently, I thought that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.