unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66096@debbugs.gnu.org, "ishikawa, chiaki" <ishikawa@yk.rim.or.jp>
Subject: bug#66096: High CPU usage, basically runaway emacs with visit to bidi_cache_search on and off?
Date: Thu, 21 Sep 2023 10:36:53 +0900	[thread overview]
Message-ID: <b99d39cd-b2f2-4d9f-9148-547b6a4e143d@yk.rim.or.jp> (raw)
In-Reply-To: <83o7hxasfg.fsf@gnu.org>

On 2023/09/20 22:24, Eli Zaretskii wrote:
>> Date: Wed, 20 Sep 2023 16:09:03 +0900
>> Cc: 66096@debbugs.gnu.org, "ishikawa, chiaki" <ishikawa@yk.rim.or.jp>
>> From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
>>
>> I have the following code snippet to monitor GC issues on my PC for
>> quite sometime.
>> But I have not seen this particular problem before.
>> The long pause I have seen before was strictly in GC-related routines.
>>
>> (setq my-gc-statistics (make-vector 30 nil))
>>
>> ;;; The element is
>> ;;; (append (memory-use-counts) (list gc-elapsed gcs-done))
>> ;;; Each time the following function is called, the
>> ;;; elements in the array is shifted toward the end.
>> ;;; Use (message "%S" my-gc-statistics) to force the
>> ;;; recording of my-gc-statistics value in *Messages* buffer for later
>> analysis.
>>
>>
>> (defun update-my-gc-statistics ()
>>     (let ((i 28))
>>       (progn
>>        ;;; very unlike Lisp
>>        (while (<= 0 i)
>>          (progn (aset my-gc-statistics (+ 1 i) (aref my-gc-statistics i))
>>                (setq i (- i 1) )))
>>        (aset my-gc-statistics 0
>>              (append (memory-use-counts) (list gc-elapsed gcs-done)))
>>        ;;; print the latest one last so that I can see the glimpse in the
>> narrow
>>        ;;; output window.
>>        (message "%S\n%S" (current-time-string) (pp (reverse
>> my-gc-statistics))))))
>>
>> (setq post-gc-hook 'update-my-gc-statistics)
>>
>> For example, in one place, I see
>> #0  0x0000556f1905be9e in string_char_and_length
>>       (length=<synthetic pointer>, p=0x556f20d8a3d8 " 70337 417360
>> 2.323839139 50)\n (99058573 3875 59193441 34949 11084445 70337 417401
>> 2.391973008 51)]\n\"") at
>> /home/ishikawa/repos/emacs-29.1/src/character.h:375
>>
>> And that string is probably   from (append (memory-use-counts) (list
>> gc-elapsed gcs-done))
> I tried to run with this, and I don't see any such infloop.  I see the
> GC results displayed in the echo-area once in a while.
>
> I guess some other customizations cause this, or maybe some special
> circumstances with different fonts you use.  Customizations that
> affect the echo-area display and resizing are of main interest.  If
> you can try to reproduce this in "emacs -Q", with only the
> post-gc-hook defined and as little of your other customizations as
> possible, it could help.
>
>> Also I see recursive_edit at the bottom of the stakctrace.
>> Not sure why. Maybe I was doing some error recovery of Japanese input?
> No, this is normal: Emacs enters one level of recursive-edit when it
> starts.

Thank you for the comment.

Yeah, I noticed strange font-related functions in a stacktrace.
In any case, if I see the issue with a file being edited,
I will report it.
I have re-compiled emacs with the flags suggested in etc/DEBUG for now.


Chiaki







      reply	other threads:[~2023-09-21  1:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  4:12 bug#66096: High CPU usage, basically runaway emacs with visit to bidi_cache_search on and off? ISHIKAWA,chiaki
2023-09-19 11:04 ` Eli Zaretskii
2023-09-20  7:09   ` ISHIKAWA,chiaki
2023-09-20  7:16     ` ISHIKAWA,chiaki
2023-09-20 13:24     ` Eli Zaretskii
2023-09-21  1:36       ` ISHIKAWA,chiaki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b99d39cd-b2f2-4d9f-9148-547b6a4e143d@yk.rim.or.jp \
    --to=ishikawa@yk.rim.or.jp \
    --cc=66096@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).