ledger-mode icon indicating copy to clipboard operation
ledger-mode copied to clipboard

Sudden high CPU use/freeze

Open ghost opened this issue 7 years ago • 6 comments

I'm not completely sure of the steps to reproduce yet, nor have I tried ledger-mode on this file without my emacs config loaded, but here is what I have so far:

  1. Emacs 22.1.1 (OSX)
  2. Ledger file around 1000 lines
  3. Create new entry (manually), with date, asterisk (resolved), description
  4. Move to destination line and type account, followed by two spaces and currency amount
  5. Interface locks up with emacs CPU use at 100%.

Current workaround:

  • Input entries in text-mode until satisfied, then invoke ledger-mode at the end
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Column-Number Diff-Auto-Refine Display-Battery Easy-Repeat Electric-Indent
Electric-Pair Fci File-Name-Shadow Flycheck Font-Lock Global-Easy-Repeat
Global-Eldoc Global-Electric-Pair Global-Fci Global-Flycheck Global-Font-Lock
Global-Rainbow-Delimiters Ivy Line-Number Mouse-Wheel Override-Global
Rainbow-Delimiters Shell-Dirtrack Tooltip Transient-Mark

(Information about these minor modes follows the major mode info.)

Ledger mode defined in ‘ledger-mode.el’:
A mode for editing ledger data files.

ghost avatar May 14 '17 21:05 ghost

What other modes are enabled? Do you have any reports running in other buffers?

On Sun, May 14, 2017 at 14:38 bright-star [email protected] wrote:

I'm not completely sure of the steps to reproduce yet, nor have I tried ledger-mode on this file without my emacs config loaded, but here is what I have so far:

  1. Emacs 22.1.1 (OSX)
  2. Ledger file around 1000 lines
  3. Create new entry (manually), with date, asterisk (resolved), description
  4. Move to destination line and type account, followed by two spaces and currency amount
  5. Interface locks up with emacs CPU use at 100%.

Current workaround:

  • Input entries in text-mode until satisfied, then invoke ledger-mode at the end

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ledger/ledger-mode/issues/33, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1rLDsZd-g0Gc1cjQcw2zf69cG178jwks5r53RugaJpZM4Nag6L .

-- Craig, Corona De Tucson, AZ [image: missile_flyout] enderw88.wordpress.com

enderw88 avatar May 14 '17 21:05 enderw88

I don't have any reports running in other buffers.

I updated to Emacs 25 and haven't been able to replicate the issue so far, but I'll reopen this ticket if it pops up again.

ghost avatar May 14 '17 21:05 ghost

I've encountered this issue. I disabled all minor modes whilst in ledger-mode and the problem only occurs when the Font-Lock minor mode is enabled. Emacs version is GNU Emacs 25.2.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9).

The following snippet triggers Emacs to freeze once the space has been entered after Rent.

~ Monthly
    Expenses:Rent 

wlkr avatar Aug 14 '17 15:08 wlkr

I'll give this a try. I also consistently encounter this when entering categories.

ghost avatar Aug 14 '17 16:08 ghost

I'm not sure if this is of too much help but I used the profiler on CPU usage and when entering the above snippet I get the following results.

- redisplay_internal (C function)                                1366  81%       
 - jit-lock-function                                             1366  81%       
  - jit-lock-fontify-now                                         1366  81%       
   - jit-lock--run-functions                                     1366  81%       
    - run-hook-wrapped                                           1366  81%       
     - #<compiled 0x4039c3ef>                                    1366  81%       
      - font-lock-fontify-region                                 1366  81%       
       - ledger-fontify-buffer-part                              1366  81%       
        - ledger-fontify-xact-at                                 1366  81%       
         - ledger-fontify-xact-by-line                           1306  78%       
          + ledger-fontify-posting                                803  48%       
             ledger-fontify-set-face                               37   2%

wlkr avatar Aug 21 '17 22:08 wlkr

Do you still see this behavior? ledger-mode's font-locking system got rewritten so hopefully this is fixed.

jabranham avatar Oct 08 '19 16:10 jabranham

It looks like OP has closed their account therefore @jabranham I think we can close this issue. If people still suffer from this issue then they can open a new issue, no?

doolio avatar Jan 04 '24 13:01 doolio

Agreed. Closing.

bcc32 avatar Mar 18 '24 06:03 bcc32