Skip to content
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

Peek often crashes Ubuntu Xenial #162

Closed
anavarre opened this issue Jul 6, 2017 · 4 comments
Closed

Peek often crashes Ubuntu Xenial #162

anavarre opened this issue Jul 6, 2017 · 4 comments

Comments

@anavarre
Copy link

anavarre commented Jul 6, 2017

It's been a few times already I'm getting my Ubuntu to crash on me and there's no other way than doing a REISUB to restart. Everything freezes and I have no way to see what is happening, but it does look like either CPU or RAM (or both) are getting heavily used when rendering the GIF file. Usually my files are below 30s long (rather 15s) and there's only one window involved.

Using:

$ peek -v
Peek 1.0.3
$ uname -ar
Linux thinkpad 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

Let me know if there's anything else you need to know. I'm under the impression #125 could be related.

@phw phw added the duplicate label Jul 7, 2017
@phw
Copy link
Owner

phw commented Jul 7, 2017

This sounds very much like you system runs out of RAM and starts swapping, so yes, I think this is kind of a duplicate of #125.

How much RAM do you have, and especially how much is available?

One thing to try would be the reverse of what is suggested in #112 (comment) and follow-up posts: So instead of increasing the resource limits, try to set them to a value that actually is available on your system. Of course if you set it too strict you could end with the error of #112 . But if this works for you I would be very much interested in the values :)

@anavarre
Copy link
Author

anavarre commented Jul 7, 2017

Typical memory usage involves 2 Chrome sessions, Spotify, Telegram, Dropbox, a dropdown terminal and a few low-memory utils (Redshift, Albert, Autokey...)

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          11707        5852        1908         614        3945        4131
Swap:          1906         754        1152

Reading #112 again, I found:

$ for i in memory disk; do grep "<policy domain=\"resource\" name=\"$i\"" /etc/ImageMagick-6/policy.xml ; done
  <!-- <policy domain="resource" name="memory" value="2GiB"/> -->
  <!-- <policy domain="resource" name="disk" value="16EB"/> -->

And

$ convert -list resource
  File       Area     Memory        Map       Disk   Thread  Throttle       Time
--------------------------------------------------------------------------------
   768   24.552GB  11.433GiB  22.865GiB  unlimited        4         0  unlimited

@dandv
Copy link

dandv commented Jul 17, 2017

I have the problem in #125 too, but if I record MP4s, saving is very fast, and there's no enormous RAM usage. Would it be possible to always record in MP4, and convert later that MP4 to GIF, if GIF was the selected output format? (If this is how Peek already works, apologies, but I don't see then why converting an arbitrary MP4 to GIF would crash machines.)

@phw
Copy link
Owner

phw commented Jul 17, 2017

Would it be possible to always record in MP4, and convert later that MP4 to GIF, if GIF was the selected output format?

That's basically already how it works. That conversion step is what is taking time after recording and is using up your computers resources. Just that it does not record to MP4 but to raw video, which saves one conversion step in ImageMagick.

I don't see then why converting an arbitrary MP4 to GIF would crash machines.

It doesn't "crash" your machine in that sense. It is using up you physical RAM, forcing your machine to start swapping RAM to disk, which quickly slows down everything to a crawl. You can wait it out if you are patient. At the end Peek (or more specifically the ImageMagick convert process) will either finish or, if it completely runs out of memory, crash. In a low memory situation the kernel might also decide to terminate other processes.

Closing this as a duplicate of #125

@phw phw marked this as a duplicate of #125 Jul 17, 2017
@phw phw closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants