all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
To: Eli Zaretskii <eliz@gnu.org>
Cc: chiaki.ishikawa@ubin.jp, larsi@gnus.org, 39413@debbugs.gnu.org,
	npostavs@gmail.com
Subject: bug#39413: 26.2; Emacs gets hung
Date: Wed, 11 Aug 2021 22:41:56 +0900	[thread overview]
Message-ID: <277eef17-0241-7245-a801-dc3707c23e5b@yk.rim.or.jp> (raw)
In-Reply-To: <83wnosdwyt.fsf@gnu.org>

Hi,

Sorry, I might have picked up too early dumps in my previous e-mail.

What about the dump below, which was in the *Messages* buffer following 
dump I sent.
I am afraid I picked up the wrong dump in my previous e-mail.

Now, is "gc-elapsed" the elapsed time spent in the GC routine?
If so, the two samples at the end of the dump here certainly look 
suspicious.
Actually, I saw a very long GC and after that,
I manually invoked GC by M-X garbage-collect and to my surprise THAT 
also turned out to take a long time to finish. I was hoping the first GC 
somehow aligned memory structure in a neat order, but that did not seem 
to be the case.

But as far as the amount of memory consumed does not differ much from 
other short-lived GC.
Or for whatever the reason, a small amount of memory increase may have
an unexpected effect on this CPU, AMD Ryzen 7 1700 Eight-Core Processor 
3.00 GHz?
Again, this is very unlikely. I have not seen this slow GC until about a 
year ago which forced me to file a bug report. Also, the attached dump 
shows that there are two tandem GC which took a long time, but other GCs 
that follow are short-lived.

I am still suspecting a certain  form of inefficiency due to allocation 
pattern of strings [I am assuming that strings are allocated and then 
added to the shell buffer, maybe I am wrong. It may be a long repetitoon 
of realloc?]  to store  longish output lines and then short lines 
produced by the particular compile/build process into the Shell buffer 
(M-X shell) in which I ran largish compilation/link process for mozilla 
thunderbird.

This could be purely due to excessive cache misses caused by particular 
memory access patterns during GC to handle my particular memory 
allocation patterns. But I have no idea.
I may have to find out the cache miss #.

Chiaki

Here is the suspect:  the last two lines look very suspicious.

C-M-g is undefined
Quit
[(393068244 12665 325413926 37859 257099914 12428854 8802846 
221.552147241 933)
  (402532085 12666 325423645 37859 257116197 12428863 8803027 
223.487605937 934)
  (411994601 12667 325425009 37859 257132482 12428865 8803207 
225.406804595 935)
  (414448248 12668 330538753 37859 259505987 12621465 8949175 
227.343266966 936)
  (424074389 12669 330548382 37859 259522285 12621478 8949356 
229.348980796 937)
  (433699244 12670 330549685 37859 259538585 12621481 8949536 
231.351762205 938)
  (436052588 12695 335564019 37860 262003952 12804062 9088033 
233.29986785 939)
  (437421791 12754 338433175 37860 263807816 12913522 9184089 
241.951760306 940)
  (438845632 12799 341601300 37860 265238759 13012817 9274435 
243.55520882 941)
  (440178606 12842 344865373 37860 266433618 13099621 9353887 
245.138839078 942)
  (441570556 12884 348132343 37860 267683757 13189878 9438753 
246.769836844 943)
  (442913777 12925 351504882 37860 268870526 13279030 9517477 
248.360581202 944)
  (444288336 12970 354793728 37860 270325980 13371631 9601867 
249.986431307 945)
  (445752850 13021 357867712 37860 271951417 13480694 9698259 
251.625818749 946)
  (447151863 13067 361600674 37860 273497660 13567563 9778153 
253.259859431 947)
  (448657655 13112 365067032 37860 275261240 13670086 9871747 
254.994917854 948)
  (450158914 13128 368163204 37860 276859198 13782657 9970119 
256.633972618 949)
  (451707980 13129 371342199 37860 278396622 13901166 10072262 
258.313592942 950)
  (453306224 13130 374620228 37860 279986655 14023233 10177572 
260.026878125 951)
  (464657341 13133 374630765 37860 280003882 14023235 10177761 
261.742461495 952)
  (476005819 13134 374631080 37860 280018058 14023235 10177809 
263.587127108 953)
  (477506723 13182 378534545 37862 281816769 14095140 10272953 
265.478689001 954)
  (478847002 13223 383581993 37862 283960864 14103107 10329518 
267.316126049 955)
  (479979175 13239 389369881 37862 285520586 14104493 10350952 
269.874493833 956)
  (481386726 13240 394330012 37862 287576346 14129844 10386458 
272.129021279 957)
  (483293142 13241 396849752 37862 290130666 14268679 10526833 
274.668402532 958)
  (485150904 13267 399531895 37862 292954354 14397053 10681026 
276.994701437 959)
  (520316838 13502 402388436 37862 368141808 16928818 10788359 
279.346871091 960)
  (520636475 13796 402726636 37868 370978420 16933589 10826355 
422.114721386 961)  <=
  (520702163 13807 402879841 38129 371108294 16933644 10830730 
620.747356527 962)] <=

and a couple of hours later.: I did not do a lot during this time.

Mark set
Auto-saving...done
Saving file /home/ishikawa/Dropbox/todo-memo-home.txt...
Wrote /home/ishikawa/Dropbox/todo-memo-home.txt
Saving file /home/ishikawa/Dropbox/todo-memo-home.txt...
Wrote /home/ishikawa/Dropbox/todo-memo-home.txt
Saving file /home/ishikawa/Dropbox/todo-memo-home.txt...
[(436052588 12695 335564019 37860 262003952 12804062 9088033 
233.29986785 939)
  (437421791 12754 338433175 37860 263807816 12913522 9184089 
241.951760306 940)
  (438845632 12799 341601300 37860 265238759 13012817 9274435 
243.55520882 941)
  (440178606 12842 344865373 37860 266433618 13099621 9353887 
245.138839078 942)
  (441570556 12884 348132343 37860 267683757 13189878 9438753 
246.769836844 943)
  (442913777 12925 351504882 37860 268870526 13279030 9517477 
248.360581202 944)
  (444288336 12970 354793728 37860 270325980 13371631 9601867 
249.986431307 945)
  (445752850 13021 357867712 37860 271951417 13480694 9698259 
251.625818749 946)
  (447151863 13067 361600674 37860 273497660 13567563 9778153 
253.259859431 947)
  (448657655 13112 365067032 37860 275261240 13670086 9871747 
254.994917854 948)
  (450158914 13128 368163204 37860 276859198 13782657 9970119 
256.633972618 949)
  (451707980 13129 371342199 37860 278396622 13901166 10072262 
258.313592942 950)
  (453306224 13130 374620228 37860 279986655 14023233 10177572 
260.026878125 951)
  (464657341 13133 374630765 37860 280003882 14023235 10177761 
261.742461495 952)
  (476005819 13134 374631080 37860 280018058 14023235 10177809 
263.587127108 953)
  (477506723 13182 378534545 37862 281816769 14095140 10272953 
265.478689001 954)
  (478847002 13223 383581993 37862 283960864 14103107 10329518 
267.316126049 955)
  (479979175 13239 389369881 37862 285520586 14104493 10350952 
269.874493833 956)
  (481386726 13240 394330012 37862 287576346 14129844 10386458 
272.129021279 957)
  (483293142 13241 396849752 37862 290130666 14268679 10526833 
274.668402532 958)
  (485150904 13267 399531895 37862 292954354 14397053 10681026 
276.994701437 959)
  (520316838 13502 402388436 37862 368141808 16928818 10788359 
279.346871091 960)
  (520636475 13796 402726636 37868 370978420 16933589 10826355 
422.114721386 961) <=
  (520702163 13807 402879841 38129 371108294 16933644 10830730 
620.747356527 962) <=
  (520801350 13855 402954201 38197 371207595 16935253 10837272 
620.862288325 963)
  (520860834 13895 403094379 38257 371361488 16936922 10844603 
620.954004521 964)
  (520960277 14286 403145781 38257 371718646 16938526 10849771 
621.0046367 965)
  (521023418 14444 403221395 38259 372414726 16940131 10857263 
621.049176975 966)
  (521071758 14508 403310401 38260 373187220 16940139 10866947 
621.097972876 967)
  (521097606 14509 403398321 38260 374994158 16940147 10867991 
621.156022718 968)]

On 2021/08/11 20:47, Eli Zaretskii wrote:
>> Cc: Noam Postavsky <npostavs@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
>>   39413@debbugs.gnu.org,
>>   chiaki-ishikawa-thunderbird-account <chiaki.ishikawa@ubin.jp>
>> From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
>> Date: Wed, 11 Aug 2021 15:07:26 +0900
>>
>> Good news. I could capture at least something that shows what happens
>> when the Emacs seems to spend strangely large amount of time in GC and
>> for all practical purposes it gets hung for a couple of minutes.
> I don't see this in the data you sent:
>
>> [(388481492 12663 315852263 37859 252680715 12068535 8530128
>> 217.751094438 931)
>>    (390762053 12664 320601077 37859 254857509 12248048 8666125
>> 219.633925136 932)
>>    (393068244 12665 325413926 37859 257099914 12428854 8802846
>> 221.552147241 933)
>>    (402532085 12666 325423645 37859 257116197 12428863 8803027
>> 223.487605937 934)
>>    (411994601 12667 325425009 37859 257132482 12428865 8803207
>> 225.406804595 935)
>>    (414448248 12668 330538753 37859 259505987 12621465 8949175
>> 227.343266966 936)
>>    (424074389 12669 330548382 37859 259522285 12621478 8949356
>> 229.348980796 937)
>>    (433699244 12670 330549685 37859 259538585 12621481 8949536
>> 231.351762205 938)
>>    (436052588 12695 335564019 37860 262003952 12804062 9088033
>> 233.29986785 939)
>>    (437421791 12754 338433175 37860 263807816 12913522 9184089
>> 241.951760306 940)
>>    (438845632 12799 341601300 37860 265238759 13012817 9274435
>> 243.55520882 941)
>>    (440178606 12842 344865373 37860 266433618 13099621 9353887
>> 245.138839078 942)
>>    (441570556 12884 348132343 37860 267683757 13189878 9438753
>> 246.769836844 943)
>>    (442913777 12925 351504882 37860 268870526 13279030 9517477
>> 248.360581202 944)
>>    (444288336 12970 354793728 37860 270325980 13371631 9601867
>> 249.986431307 945)
>>    (445752850 13021 357867712 37860 271951417 13480694 9698259
>> 251.625818749 946)
>>    (447151863 13067 361600674 37860 273497660 13567563 9778153
>> 253.259859431 947)
>>    (448657655 13112 365067032 37860 275261240 13670086 9871747
>> 254.994917854 948)
>>    (450158914 13128 368163204 37860 276859198 13782657 9970119
>> 256.633972618 949)
>>    (451707980 13129 371342199 37860 278396622 13901166 10072262
>> 258.313592942 950)
>>    (453306224 13130 374620228 37860 279986655 14023233 10177572
>> 260.026878125 951)
>>    (464657341 13133 374630765 37860 280003882 14023235 10177761
>> 261.742461495 952)
>>    (476005819 13134 374631080 37860 280018058 14023235 10177809
>> 263.587127108 953)
>>    (477506723 13182 378534545 37862 281816769 14095140 10272953
>> 265.478689001 954)
>>    (478847002 13223 383581993 37862 283960864 14103107 10329518
>> 267.316126049 955)
>>    (479979175 13239 389369881 37862 285520586 14104493 10350952
>> 269.874493833 956)
>>    (481386726 13240 394330012 37862 287576346 14129844 10386458
>> 272.129021279 957)
>>    (483293142 13241 396849752 37862 290130666 14268679 10526833
>> 274.668402532 958)
>>    (485150904 13267 399531895 37862 292954354 14397053 10681026
>> 276.994701437 959)
>>    (520316838 13502 402388436 37862 368141808 16928818 10788359
>> 279.346871091 960)]
> Look at the 2 last numbers in each sample: the count of GC cycles goes
> up by one, and the elapsed accumulated time spent in GC goes up by 2.5
> sec for each GC cycle.  That's nowhere near the couple of minutes
> value you report.  Could it be that the Emacs process doesn't get CPU
> resources?
>






  reply	other threads:[~2021-08-11 13:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  9:32 bug#39413: 26.2; Emacs gets hung chiaki-ishikawa-thunderbird-account
2020-02-04 15:33 ` Eli Zaretskii
2020-02-05  1:11   ` chiaki-ishikawa-thunderbird-account
2020-02-21 17:27 ` Noam Postavsky
2020-02-22 17:53   ` chiaki-ishikawa-thunderbird-account
2020-04-28 21:36     ` ISHIKAWA,chiaki
2020-04-29  6:55       ` Eli Zaretskii
2020-04-30  2:45         ` chiaki-ishikawa-thunderbird-account
2020-05-20  4:31           ` chiaki-ishikawa-thunderbird-account
2020-05-25 12:15             ` Noam Postavsky
2020-05-25 15:50               ` chiaki-ishikawa-thunderbird-account
2020-06-08  8:17                 ` chiaki-ishikawa-thunderbird-account
2021-08-10 16:09                 ` Lars Ingebrigtsen
2021-08-11  1:08                   ` ISHIKAWA,chiaki
2021-08-11  6:07                     ` ISHIKAWA,chiaki
2021-08-11  7:22                       ` ISHIKAWA,chiaki
2021-08-11 11:14                       ` Lars Ingebrigtsen
2021-08-11 13:46                         ` ISHIKAWA,chiaki
2021-08-11 11:47                       ` Eli Zaretskii
2021-08-11 13:41                         ` ISHIKAWA,chiaki [this message]
2021-08-12  7:10                           ` Eli Zaretskii
2021-08-15 23:27                             ` ISHIKAWA,chiaki
2021-08-16  0:20                               ` ISHIKAWA,chiaki
2021-08-16 11:35                               ` Eli Zaretskii
2021-08-20  1:56                                 ` ISHIKAWA,chiaki
2021-09-17 14:49                                   ` Lars Ingebrigtsen
2021-10-18  9:00                                     ` Lars Ingebrigtsen
2021-10-19  7:04                                       ` ISHIKAWA,chiaki

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

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

  git send-email \
    --in-reply-to=277eef17-0241-7245-a801-dc3707c23e5b@yk.rim.or.jp \
    --to=ishikawa@yk.rim.or.jp \
    --cc=39413@debbugs.gnu.org \
    --cc=chiaki.ishikawa@ubin.jp \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=npostavs@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.