Avoiding autosave of JDEE flycheck files?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Avoiding autosave of JDEE flycheck files?

Steinar Bang
Platform: debian 9.7 "stretch", amd64, emacs 25.1+1-4+deb9u1,
          jdee 20180831.1500 (from melpa)

I'm getting a lot of messages like this, when exiting emacs, and when
running M-x compile :
 Save file /tmp/JDEE_flycheck_16412_kQ/Role.java? (y, n, !, ., q, C-r or C-h)

Is there a way to not get autosave for these files?

An extra datapoint: I'm using emacs-desktop to restore the desktop where
this occurs.  I don't know if that's significant or not?

Thanks!


- Steinar

Reply | Threaded
Open this post in threaded view
|

100% CPU usage on emacs startup (Was: Avoiding autosave of JDEE flycheck files?)

Steinar Bang
>>>>> Steinar Bang <[hidden email]>:

> Platform: debian 9.7 "stretch", amd64, emacs 25.1+1-4+deb9u1,
>           jdee 20180831.1500 (from melpa)

> I'm getting a lot of messages like this, when exiting emacs, and when
> running M-x compile :
>  Save file /tmp/JDEE_flycheck_16412_kQ/Role.java? (y, n, !, ., q, C-r or C-h)

This problem seems to have gone away, however...

> An extra datapoint: I'm using emacs-desktop to restore the desktop where
> this occurs.  I don't know if that's significant or not?

When starting up and restoring the desktop emacs uses 100% of one of the
cores, and after 1h of starup still hasn't completed (and this is a
pretty fast machine).

Does anyone know what causes this?  Is emacs-desktop restore and JDEE
just a bad mix?

One more datapoint: this is when using remote X display over an SSH
connection with X forwarding.

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: 100% CPU usage on emacs startup

Steinar Bang
>>>>> Steinar Bang <[hidden email]>:
>>>>> Steinar Bang <[hidden email]>:

>> Platform: debian 9.7 "stretch", amd64, emacs 25.1+1-4+deb9u1,
>> jdee 20180831.1500 (from melpa)

>> I'm getting a lot of messages like this, when exiting emacs, and when
>> running M-x compile :
>> Save file /tmp/JDEE_flycheck_16412_kQ/Role.java? (y, n, !, ., q, C-r or C-h)

> This problem seems to have gone away, however...

I think the reason the temp file went away was that I defined the
jdee-server-dir to point to a directory containing the jar file of the
jdee server
 https://github.com/jdee-emacs/jdee-server

>> An extra datapoint: I'm using emacs-desktop to restore the desktop where
>> this occurs.  I don't know if that's significant or not?

> When starting up and restoring the desktop emacs uses 100% of one of the
> cores, and after 1h of starup still hasn't completed (and this is a
> pretty fast machine).

> Does anyone know what causes this?  Is emacs-desktop restore and JDEE
> just a bad mix?

I think this is the case.  In one case emacs eventually came up restored
after 1h 15 minutes of 100% CPU usage on one of the cores of a 3.5GHz
Intel i5-6600 "Skylake" CPU.

However, I removed JDEE, and tried a restore, and emacs desktop restore
was taking too long to restore to be useful (I didn't let it run its
course so I don't know exactly too long).

So I reinstalled JDEE (which does Java formatting a lot better than the
plain old java-mode) and removed the .emacs.desktop and started fresh
and now it works good enough again.

So I guess the simplest solution is to simply delete the .emacs.desktop
once emacs startup becomes too slow to be useful.  

It's good enough for my use case, which is basically to continue where I
was yesterday, and if I have to restart from time to time it's no worse
than when I have to restore my desktop because and OS update causes a
system restart.

Reply | Threaded
Open this post in threaded view
|

Re: 100% CPU usage on emacs startup

Steinar Bang
>>>>> Steinar Bang <[hidden email]>:

>>> An extra datapoint: I'm using emacs-desktop to restore the desktop where
>>> this occurs.  I don't know if that's significant or not?

>> When starting up and restoring the desktop emacs uses 100% of one of the
>> cores, and after 1h of starup still hasn't completed (and this is a
>> pretty fast machine).

>> Does anyone know what causes this?  Is emacs-desktop restore and JDEE
>> just a bad mix?

> I think this is the case.  In one case emacs eventually came up restored
> after 1h 15 minutes of 100% CPU usage on one of the cores of a 3.5GHz
> Intel i5-6600 "Skylake" CPU.

Now I know what happens:
When the emacs desktop is restored it restores a heap of java files with
names like this (the part after _flycheck_ is different and the filename
is different, one Java file in each directory):
 /tmp/JDEE_flycheck_1004026G/ErrorBean.java

When the files are restored they are taken to be regular .java files and
JDEE tries to figure out what project they are part of and outputs a
heap of error messages.

And the number of restored files baloons every time emacs.desktop is
restored, which eventually results in emacs spending more than 1h at
100% CPU to start up, so yes, emacs desktop and JDEE *is* a very bad
match...:-)

Is there a simple way to exclude these files from emacs.desktop restore,
I wonder...?

Excluding the entire /tmp/ directory would be fine by me.

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: 100% CPU usage on emacs startup

Eli Zaretskii
> From: Steinar Bang <[hidden email]>
> Date: Sun, 03 Feb 2019 19:17:38 +0100
>
> Is there a simple way to exclude these files from emacs.desktop restore,
> I wonder...?

There are the user options desktop-buffers-not-to-save and
desktop-files-not-to-save.

Reply | Threaded
Open this post in threaded view
|

Re: 100% CPU usage on emacs startup

Steinar Bang
>>>>> Eli Zaretskii <[hidden email]>:

>> Is there a simple way to exclude these files from emacs.desktop restore,
>> I wonder...?

> There are the user options desktop-buffers-not-to-save and
> desktop-files-not-to-save.

Thanks! I've tried adjusting desktop-files-not-to-save to
 "\\(^/[^/:]*:\\|(ftp)$\\|^/tmp\\)"

I'll report back how this works out.


Reply | Threaded
Open this post in threaded view
|

Re: 100% CPU usage on emacs startup

Steinar Bang
>>>>> Steinar Bang <[hidden email]>:
>>>>> Eli Zaretskii <[hidden email]>:

>>> Is there a simple way to exclude these files from emacs.desktop
>>> restore, I wonder...?

>> There are the user options desktop-buffers-not-to-save and
>> desktop-files-not-to-save.

> Thanks! I've tried adjusting desktop-files-not-to-save to
>  "\\(^/[^/:]*:\\|(ftp)$\\|^/tmp\\)"

> I'll report back how this works out.

Adding all files under /tmp to desktop-files-not-to-save seems to work:
startup times are reasonable and the /tmp files are not saved to
.emacs.desktop