louis030195 / screen-pipe

Record your screen & mic 24/7 and connect it to LLMs. Inspired by adept.ai, rewind.ai, Apple Shortcut. Written in Rust. Free. You own your data.
https://screenpi.pe
MIT License
495 stars 15 forks source link

[bug] killed:9 #15

Closed louis030195 closed 2 days ago

louis030195 commented 4 days ago

:)

A "Killed: 9" error typically indicates that your program was forcibly terminated by the operating system, often due to excessive memory usage or other resource constraints. This is also known as the "SIGKILL" signal.

Based on the log messages and the error, here are a few potential reasons for this issue:

  1. FFmpeg not found: The warning message suggests that FFmpeg wasn't found in the expected resources directory. This could lead to unexpected behavior if the program relies on a specific FFmpeg version.

  2. Memory usage: The save_frames_as_video function (lines 14-128 in the first code block) seems to be handling video encoding. If this process is consuming too much memory, it might trigger the OS to kill the program.

  3. Resource exhaustion: The program is using thread pools and multiple threads for video capture and encoding. If too many resources are being used simultaneously, it could lead to the program being terminated.

To address this issue:

  1. Ensure FFmpeg is properly installed and accessible.
  2. Monitor the memory usage of your program during execution.
  3. Consider implementing more efficient memory management in the video processing functions.
  4. Add error handling and graceful shutdown mechanisms to better manage resources.

For more detailed debugging:

  1. Run the program with increased logging.
  2. Use tools like top or htop to monitor resource usage while the program is running.
  3. Implement checkpoints in your code to identify where the program is failing.

If you need more specific advice, please provide more details about the exact circumstances when this error occurs.

louis030195 commented 4 days ago

memory is very poorly managed atm, tons of optims there anyway

louis030195 commented 4 days ago

likely memory leak (only happen after running screenpipe for 20h)

louis030195 commented 3 days ago

i solved the problem, not pushing until i tested a bit for longer times, lmk if anyone wanna try too

louis030195 commented 3 days ago

suspecting it's not even a memory issue, just apple deciding to kill the process because it's not signed and run for a while :)

https://stackoverflow.com/questions/51833310/what-is-killed9-and-how-to-fix-in-macos-terminal

louis030195 commented 2 days ago

maybe related

somehow the vision logic seems to stop running after long running overnight with sleep etc

simple workaround now is to have program reboot itself after a while

louis030195 commented 2 days ago

suspecting it's not even a memory issue, just apple deciding to kill the process because it's not signed and run for a while :)

https://stackoverflow.com/questions/51833310/what-is-killed9-and-how-to-fix-in-macos-terminal

this was the issue

signing the executable solved problem