this post was submitted on 26 Nov 2023
1 points (100.0% liked)

Emacs

310 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

Hello fellow Emacs enthusiasts,

I'm reaching out to see if there's anyone here who's successfully integrated a modern development environment within Emacs for Python programming. Specifically, I'm interested in a setup that incorporates eglot, tree-sitter and company.

I've encountered a significant issue: whenever I enable python-ts-mode, Emacs consumes all my system's memory and crashes. While I've managed to use a more basic setup that limits tree-sitter to syntax highlighting only, I can't shake the feeling that I'm missing out on some great functionality.

To help with investigation:

  • I am running on a Mac
  • The bare minimum to reproduce this problem is on the following gist: https://gist.github.com/hnarayanan/a6397d6723fce19e2802d4305071e611
  • I happen to use Emacs from MacPorts, but to double-check, I also attempted to download it from https://emacsformacosx.com and it crashed in the same way
  • This seems to happen independent of the language server used in the backend. I intend on using python-lsp-server, but it fails even if I don't have it installed.

Has anyone faced a similar problem and found a solution? Perhaps I am doing something very wrong with my config? I'm eager to learn from your experiences and would greatly appreciate any advice or tips you can offer.

Thank you!

you are viewing a single comment's thread
view the rest of the comments
[–] rileyrgham@alien.top 1 points 11 months ago (3 children)

I'd doubt it's treesitter. It could be, of course. The LSP server more likely. If using Linux run htop or something and check memory usage. Edit: Mac. Find the htop equivalent.

[–] copingbear@alien.top 1 points 11 months ago (2 children)

Thank you for the hint. It is even prior to the LSP (I think), because I run the LSP within a virtualenv that I can choose to not activate. And in either case it is Emacs taking up like 30+ GB of memory until I force kill it: https://imgur.com/a/F6liREU

[–] mnp@alien.top 1 points 11 months ago

Well, they used to call it "Eight Megabytes and Constantly Swapping" :-) One could only wish, now!

Seriously, I've also seen some poor behavior with ts-mode and ts-folding also, maybe with python or yaml, ending in a hang or crash, not sure of specifics yet. I'll pay better attention next time.

load more comments (1 replies)
load more comments (1 replies)