-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hangs (spinning beachball) and sucks memory #807
Comments
This is exactly what I see, but I don't correlate it with MathJax. I think there's some buffering problem in the editor since when I'm doing something like deleting or typing fast is when it will happen. It's sometimes just unusable. |
Sometimes when I force quit an application, macOS gives a pop up saying something like "MacDown quit unexpectedly" or "MacDown is not responding". Did you guys meet such pop-up dialog window? |
No. I have to go to the Activity Monitor in order to see that it's "not responding"...and it's then probably taking more than 100% of CPU. I force quit it from there, not from the Apple menu. Glad you're looking at it, as it's the single thing that keeps me from relying on MacDown...it's so useful that I keep going back but then frustrating because of the hanging...that I then leave for a while! Is there any way after the fact to capture any data that would help? |
Just hung on my again. Here's a sample immediately after:
I cut out about 600 lines of this... the attachment is the whole dump |
@chipbrock Thank you very much for the stack dump. That definitely seems wrong. |
Looks like an infinite loop (or recursion). Will need to investigate to know where exactly this happens though. |
@chipbrock I don't think so; you are probably just being lucky. Will still need to investigate about this issue. |
yes. it was luck. it happened again and I deleted the optimistic comment…
sorry
On May 15, 2017, at 3:20 PM, Franklin Yu <notifications@github.com<mailto:notifications@github.com>> wrote:
@chipbrock<https://github.com/chipbrock> I don't think so; you are probably just being lucky. Will still need to investigate about this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#807 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AETlzQJWiw3BWU2HupDYjh-2d7sayy09ks5r6KWDgaJpZM4NaK0k>.
…---------------------------------------------------------------
Raymond Brock * University Distinguished Professor
Department of Physics and Astronomy
3210 BPS Building
Michigan State University * East Lansing, MI 48824
sent from: raymond.brock@gmail.com<mailto:raymond.brock@gmail.com>
brock@pa.msu.edu<mailto:brock@pa.msu.edu>
MSU office: (517)353-1693/884-5579
open fax: (517)355-6661
secure fax: (517)351-0688
Vidyo personal room: http://goo.gl/AgiDJ4
CERN Office: 32 2-B03 * 76-71756
Twitter: @chipbrock
Home: http://www.pa.msu.edu/~brock/
ISP220: http://www.pa.msu.edu/courses/ISP220/
ISP213H: http://www.pa.msu.edu/courses/2007spring/ISP213H/
Facebook: http://msu.facebook.com/profile.php?id=2312233
|
I'm having this same issue with 0.7.1: When editing a file that contains Mathjax, eventually I'll get a beachball/freeze. It seems to be fine on relaunch as long as I don't make any edits. Note that the edits don't have to be in the Mathjax portion of the markdown to cause the freeze. Stack dump excerpt:
|
any progress? I'm willing go try a beta of an update. this is a great app and will change my workflow considerably so I'm eager for it to succeed! |
The call graph mentioned |
Anyone provide some sample Markdown file that ever crashed MacDown, for us to test? |
hi I've attached the (draft!!) file that I've been working on. Since I first posted, it's about twice as long as it was and does have one javascript reliance (a tool to convert dimensions) that it didn't have when I first started having trouble. It lives inside of a Jekyll environment. Git won't let me upload an mmd document directly. It's zipped I hope you can find the issue! I know that Macdown would make my life easier. I've been using Atom since this became a problem. I've also looked at Lightpaper, but it's dreadfully slow to render mathematics and the active preview does not sync properly. thanks |
I've had similar problems editing files with multiple latex equations. This was memory usage, which was still climbing when I killed the process: |
I have opened the Markdown files (both from @danielparton and @chipbrock) and kept it in background for an hour. Nothing has happened.
|
I had a number of apps open - a lot of Chrome tabs. But still had 6GB RAM free without MacDown running. I tried closing MacDown and re-opening the file a few times. Each time, I'd be able to edit a few characters, then the same thing would happen - spinning beach ball, and the memory starts spiking. It has happened to me a few times before with other files. Pretty sure it has always occurred in files with a fairly large number of mathjax equations (say around 10 or more). OS X version: 10.12.5 Thanks for looking into this! MacDown is awesome. Let me know if there's anything else I can do to help debug. |
Since this occurs only recently, I can think of a couple of possibilities:
My gut instinct points the second one. And if I’m correct (no guarantee), the solution would be to host MathJax locally, or do some manual caching as mentioned in #789 (comment). |
Wait, how would memory be eaten by jamming the CPU? |
The issue that I found was not related to memory consumption…I don’t think. And it never happened when nothing was going on. I had to be typing fast, deleting text, or something that was high rate at the keyboard. Then it would hang. I kept thinking that there was some buffering that would saturate. If I wait for a long time, the spinning beachball would eventually stop and I could continue.
I don’t remember who it was that suggested this, but I too believe that it’s a lot more stable when I turn off the automatic rendering and just do command-R when I want it to.
I’m running 10.12.3 on 3 computers, all of which exhibit the issue. I’ve actually upgraded two of them yesterday.
Reading ahead, to Tzu-ping’s concern about MathJax. I don’t think that’s the problem as I’m pretty sure that I found the bad behavior before the MathJax hosting change.
Sierra made some serious changes. If the developers were not using it, I’ll bet that something broke in the update.
As for when this happens? Every time I tried, so I moved to Atom to work. I’ve come back because of the suggestion of removing auto-render.
thanks for looking at this…
chip brock
On Jun 21, 2017, at 11:45 PM, Franklin Yu <notifications@github.com<mailto:notifications@github.com>> wrote:
I have opened the Markdown files (both from @danielparton<https://github.com/danielparton> and @chipbrock<https://github.com/chipbrock>) and kept it in background for an hour. Nothing has happened.
1. Is there anything you were doing when MacDown eats your memory?
2. When you were editing this file, how often does this (high memory consumption) happen? Always?
3. It's probably not related, but which version of macOS are you using?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#807 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AETlzTVzchK_KX6hwkpLahC9QC93a9oBks5sGeNlgaJpZM4NaK0k>.
…---------------------------------------------------------------
Raymond Brock * University Distinguished Professor
Department of Physics and Astronomy
3210 BPS Building
Michigan State University * East Lansing, MI 48824
sent from: raymond.brock@gmail.com<mailto:raymond.brock@gmail.com>
brock@pa.msu.edu<mailto:brock@pa.msu.edu>
MSU office: (517)353-1693/884-5579
open fax: (517)355-6661
secure fax: (517)351-0688
Vidyo personal room: http://goo.gl/AgiDJ4
CERN Office: 32 2-B03 * 76-71756
Twitter: @chipbrock
Home: http://www.pa.msu.edu/~brock/
ISP220: http://www.pa.msu.edu/courses/ISP220/
ISP213H: http://www.pa.msu.edu/courses/2007spring/ISP213H/
Facebook: http://msu.facebook.com/profile.php?id=2312233
|
The previous times this issue occurred (with different markdown files from the one I posted), the beachball did go away after around 5-20 seconds. I've disabled automatic rendering, so hopefully that will work as a stopgap. |
About OS versions: This started happening shortly after I upgraded to Sierra (10.12.5, I think) from 10.11.??. But it also started happening shortly after I upgraded MacDown to 0.7. So it's hard to correlate the problem with either upgrade. |
I saw this before I upgraded my OS and before upgrading the application on three computers. Any progress? thanks |
@Muxelmann The “virtual memory” is not the amount of memory actually used by an application. We should focus on the “physical memory” here. Nevertheless, 6.51 GB of physical memory is clearly unexpected; thanks for the report. |
Anyone has got any ideas? This bug is kind of driving me crazy... |
I encounter the same problem every now and then and it's really annoying. Any news on that? |
This is really a SERIOUS bug that happens every time and someone please do something... The file is a sample file from macOS Activity Monitor when this happens. |
And here is a sample file. Password is "fixit". Just do some quick typing and deletions and then it will freeze. |
For what it's worth, I was able to reproduce the problem with Goodman's file. |
Anyone know if we have a solve for this issue yet? I'm trying to write up a short document but it freezes after just a couple lines of typing. |
@goodman-capu's Markdown file consumes about 100 MB memory on my Mac, although it takes the preview about three seconds to update. The UI doesn't freeze. There is a lot of mathematics formula in the file (reminds my good old days in college, writing my assignment with LaTeX), so this file confirms again that MathJax plays a role here. |
@FranklinYu Just do some quick typing and deleting anywhere, and the UI will surely freeze. |
Any update on this issue? I'm also editing somewhat Latex heavy documents and the freezing is constant and making the app close to unusable. Mine ultimately recovers, but is pretty frustrating |
This problem is really a show stopper for MacDown. I started with disabling and re-enabling tex support constantly while writing but have now switched to a normal code editor with pandoc and a web-browser... |
@infusion @goodman-capu @MiroFurtado In my use case, if Disabling Is disabling |
Oh, that's a good hint. Thanks, I'll give that a try. |
I just submitted #930 which is helping considerably with this issue for me. It doesn't 100% solve beachballing, but when it happens its much more rare and much shorter. I'd be interested to know if this fixes for others as well. |
So it seemed better, but was still beachballing occasionally for me. I decided to dig into MathJax and try and figure out what was going wrong. You can see the cause + solution of the MathJax issue in my comment on their repo's issue. As a workaround, my latest commit bundles a fixed version of MathJax.js, and will load all other resources from the CDN as it already does. |
Adam, you are the best! Thanks for tracing the root cause of the problem. It looks you solved the problem in a way that a lot of people benefit from it. Thanks!! Could you open a PR for Mathjax? I don't know how long it will take they see activity on this closed issue. |
I don't know if this is still relevant, but I have found this issue occurs in the following situation: Internet disconnected.
Then, between the two align tags, start typing Macdown will freeze. Memory usage will surge. I wonder if it has anything to do with the fact that the underscore is both Markdown and LaTeX syntax. |
@daviewales where you able to reproduce this on the current master branch? I tried and am no longer able to get MacDown to freeze, even following these steps. |
I now believe it has something to do with poor network. Any updates on this? |
With @adamwulf's fix in MacDown #932 (plus his root cause fix being merged mathjax/MathJax#1936 in MathJax for version 2.7.4), can this be closed? What's the process to make a new MacDown release that includes this fix? |
@landalex is that fix actually considered a fix? It's more of a forced timeout in terms of not letting MacDown hang too long on refreshing the preview pane. The issue is still there however. I have manually applied the patch and compiled MacDown to test it and confirm. |
@working-name #932 actually does more than just adding the timeout—it vendors the MathJax library directly into MacDown, so parsing does not require Internet connection anymore (displaying still does because you need some web fonts to show the result). I don’t think it’d stuck on poor Internet anymore. Also I published a prerelease version containing the fix yesterday; you can test that directly. |
🎉 |
I'm using 0.7 (861) on a document with a lot of mathjax code in it. Quite often, MacDown will hang (spinning beachball) and the memory usage of the OS kernel_task goes way up; e.g. from less than 2 GB to over 5 GB. MacDown's memory also goes up. If I don't force quit macdown quickly, available physical memory hits 0 and the whole computer is almost bricked. Once I force quit MacDown, things go back to normal.
I think the problem is correlated with editing the MathJax code.
I had the same problem on the previous version (not sure the number) that I used. Although it seems more frequent since upgrading to 0.7 (861).
Great program when it works, by the way.
The text was updated successfully, but these errors were encountered: