fountain-atom icon indicating copy to clipboard operation
fountain-atom copied to clipboard

Memory Leak from Preview ?

Open martin-alt opened this issue 6 years ago • 4 comments

@superlou Sorry if I'm violating GH protocols, I'm new. First, thanks so much for creating fountain-atom, I wasn't ready to take the plunge on Highland and now that I've had 10 minutes in Atom, I don't see any reason I would (with due respect to John August, whom I do admire.)

I have noticed whenever I do an Afterwriting preview, it adds ~300MB to the memory pile, and then doesn't release it after I close the preview tab. Over many previews (writers need lots of encouragement after all) at one point I noticed it was at a whopping 18GB and I had to restart Atom altogether. Not sure if this is an Afterwriting thing, or unrelated (I'm on old 13" mid-2012 Mac, High Sierra.)

Just wanted to run it up the flagpole... Thanks again for making!

martin-alt avatar Aug 30 '19 23:08 martin-alt

This alarmed me a bit. Looking into it, I'm not seeing evidence that the fountain-atom package is directly responsible. We do generate a file based on pathing and the name of the fountain file, but it targets the same path each time. @superlou I am seeing some strange "pdf.worker.js" pop up in the Sources tab of developer tools each time a preview is rendered. I wonder if the pdf-view package is not cleaning up...

jrbostic avatar Jan 09 '20 08:01 jrbostic

@jrbostic and @martin-alt, sorry I missed this issue! I agree this is really concerning and am not sure what would cause this. @martin-alt, what OS are you using?

superlou avatar Jan 10 '20 00:01 superlou

Hi @superlou and @jrbostic, thanks much for taking a look. I'm on an old mid-2012 MBP running High Sierra 10.13.6. Atom 1.42 (via Brew if it matters) and Fountain 0.8.3.

Behavior is the same, every time I generate a new preview through Fountain (^ opt shift M) an 'Atom Helper' adds several hundred more MB to memory and doesn't let it go. It starts by adding 2-300MB but the chunks seem to get bigger with subsequent iteration, i.e. later increases are ~500MB, then ~700MB etc. Sorry, I'm not technician enough to know where to see exactly what this Atom Helper is, but its behavior is correlated with the preview action.

I just restart periodically if machine bogs down, but wouldn't mind tidying it if easy/possible for elegance sake. Thanks again for response, obviously don't devote a disproportionate amount of time – but any thoughts welcome and appreciated!

martin-alt avatar Jan 10 '20 01:01 martin-alt

We're requiring a pretty old version of pdf-view, 0.59.0, but I'm wondering if it's related to this open issue. Someone's made a new PDF viewer in response: https://github.com/Aerijo/atom-pdf-view-plus.

I started a new branch at https://github.com/superlou/fountain-atom/tree/pdf-view-plus that adds pdf-preview-plus as a dependency. However, you need to disable pdf-preview for Atom to use pdf-preview-plus. Is there a way to force a URI to use a specific plugin?

@martin-alt, you might be able to try it simply by installing pdf-preview-plus and disabling pdf-preview.

superlou avatar Jun 27 '20 21:06 superlou