That's exactly what my computer does when it's out of RAM (or close to it). Even the audio thing. It's shocking to me that this problem isn't more widely reported. It was very frustrating for me until I figured out a solution. With the following steps, I no longer have to restart my computer after it freezes due to high RAM usage:
Make sure this is actually the root cause of your problem:
The easiest way is to place a RAM monitor on your desktop's system tray. Whenever your system freezes, just look at the monitor, and you'll know immediately what the RAM usage was when your computer froze (make sure whatever widget you use updates frequently, like every 1-2 seconds, or you may miss a burst of RAM usage). If it's near max (within ~500MB), then your problem is almost certainly due to high RAM usage.
Or, monitor RAM with htop.
Problem:
The kernel already has a mechanism to kill memory-hungry processes when your computer is out of RAM. It's called the OOM killer (out of memory). The OOM killer kills the most RAM intensive process to free up memory (actually it's based on a heuristic, but it should choose one of the most RAM intensive processes unless you have tweaked other sysctl variables). Sounds like exactly what we want, right? It is, but in my experience, the kernel is very conservative in deciding when to run the OOM killer. It waits far too long. It allows my computer to hang indefinitely (RAM usage maxed out) instead of invoking the killer before anything hangs. On a desktop, I want responsiveness and don't care if the kernel has to kill my web browser in dire conditions.
Workaround:
Enable the SysRq key (details here). This will give you access to the very useful SysRq commands, including "F", which invokes the kernel OOM killer. (Take a look at the other SysRq commands as well. The REISUB sequence is especially useful!) SysRq commands should always respond, even when the system appears frozen. But I'm pretty sure I've had cases where it did not respond. Now, whenever your system freezes due to high RAM usage, press Alt+SysRq+F. It should come back to life in 1-10 seconds. If not, you can always press it again to kill another process.
Solution:
Monitor htop and watch for programs that use a ton of RAM (look at the MEM% or RES column). If you notice you're approaching max memory usage, kill offending processes. (Probably your web browser or other desktop applications... I wouldn't kill anything you don't understand.) This is the manual solution. Keep reading for a more systematic solution.
Make sure you have swap. Even if you have 16GB+ RAM.
Tell the kernel to swap early (before your computer freezes):
Increase vm.swappiness. This will make the kernel more eager to swap. I don't have hard data on this, but in general, I want the kernel to do small swaps frequently instead of waiting until I'm completely out of memory and doing a huge multi-gigabyte swap (which will noticeably hang your system until swapping is complete). However, changing this parameter alone did not solve my problem. I also had to change the next one:
Increase vm.watermark_scale_factor. (The linked page has no tutorial, but the procedure is identical to the vm.swappiness change—they are both sysctl variables.) I believe this parameter is even more important than vm.swappiness. As you can see from the link, the default value is 10 (0.1%). From my understanding, this means that the kernel may choose to never swap until until you hit 99.9% RAM usage. Even on a machine with 16GB RAM, this is unacceptable—we can't wait until all but 16MB of RAM is used. Modern applications allocate far more than this: opening a new tab in your web browser can increase RAM usage by 100MB. I want the kernel to swap early and often to maintain a healthy buffer that allows it to swap before my system ever freezes. I increased vm.watermark_scale_factor to 500 (5%) with 16GB RAM.
Keep an eye on your RAM and swap usage. If both are dangerously high, you'll get into the same situation and may need to use SysRq+F if your system freezes. Prefer to manually close programs that use a ton of memory.
Note: You may still get brief freezes (as the kernel is swapping), but they will end once swapping is complete. Putting your swap file on an SSD will speed this up. Tweaking the above parameters may help.
Tweak the parameters to figure out what works best for you (or look into other sysctl vm variables).
The most reliable way, I've found, is Xorg.conf. It offers a lot of options to customize mouse acceleration.
All the options are explained in the Xorg.conf manpage. Definitely read this over and keep it open as a reference. It will take a lot of experimenting to find the right settings. Here are my thoughts:
Both on MacOS and Windows I have my dpi on my mouse set to 1600 and about 3/4 the way up in the OS' acceleration/speed settings.
If you're referring to the general pointer speed, even before acceleration, ConstantDeceleration can solve this. For example, if your pointer is extremely fast all the time, setting ConstantDeceleration to 2 will cut the speed in half. This speed decrease is applied 100% of the time, unrelated to acceleration.
I always feel like my mouse is inaccurate and "floating" if that is an accurate way to describe it.
AccelerationProfile is relevant here. It basically defines the "curve" of the acceleration. AccelerationNumerator and AccelerationDenominator are also relevant. They define the acceleration factor as a fraction. Low factor means that acceleration doesn't effect the overall speed that much, compared to zero acceleration.
Once you have those settings tweaked, you can fine-tune it with these next two. AdaptiveDeceleration and AccelerationThreshold are useful for allowing small, precise movements without acceleration going crazy. AccelerationThreshold is simple: if the pointer speed is below this value, acceleration will never activate. AdaptiveDeceleration will actively decelerate the pointer when it's moving slowly.
...emacs has a steep learning curve, and doesn't support all the features I want.
OP mentions programs like OneNote and LibreOffice, so it's pretty clear they don't want a keyboard-centric text editor to complement their touchscreen...
I recently solved this. Firefox doesn't select fonts like other desktop applications. Here's how to make Firefox recognize system fonts:
Create & edit userChrome.css. This is in your profile directory (~/.mozilla/firefox/<PROFILE_ID>) under chrome/userChrome.css. Create this directory and file, if they don't already exist.
Let's say we want Firefox to recognize "Cool Font", a font that's installed on the system. Insert this CSS into the file:
@font-face {
font-family: "Cool Font";
font-weight: 400;
font-style: normal;
/* Find the postscript name of this font; usually a shortened font name without spaces */
src: local("<Cool Font's PostScript name>");
}
This font will now be available to Firefox; for both Firefox' native UI and for web pages. Repeat this for every font.
I noticed the exact same thing with vifm after updating to ncurses 6.0+20170401-1. Rows were colored randomly every time I moved the row selection. Downgrading to ncurses 6.0+20170128-1 fixed the issue.
CaitSith. It's a new MAC system by the author of Tomoyo. It doesn't need a patched kernel or patched packages. If you want to use network policy rules (control socket usage, etc), you need to recompile the kernel with CONFIG_SECURITY_NETWORK enabled, but that's optional. I've been running it for about 9 months, and it's been rock solid.
I don't know how it compares to grsec, but I find it perfect for a desktop system. It's a simple design, and very easy to write your own policies. For example, if we want to restrict access to /usr/bin/dmesg. Let's say, only allow its execution for root, UID 1000, or if it's being invoked from zsh:
That's it. Domains are easy to use as well. CaitSith can be used as both a blacklist and a whitelist. If you just want to protect one file, you can. You don't have to classify every file on your system. SELinux is far more comprehensive, but also more complex (and, for Arch users, a hassle to rebuild everything with audit/SELinux support).
I recently started using pacman-ps. It works in a similar way, except it handles all processes, not just systemd services. It shows the path of the upgraded file, the process using/referencing it, and the pacman package which owns it. I highly recommend it!
Make sure that the "gtk2" style is selected within the qt5ct tool itself. Also make sure that native GTK2 programs are showing the correct theme, because Qt doesn't use GTK3. If that doesn't work, try a different theme. Beyond that, I don't have any more advice. Qt 5.8 will hopefully include native GTK3 support, but I'm not sure when it will be ready for release.
I have it placed in my .xinitrc. Open your shell and check the output of this command:
$ env | grep QT_QPA
QT_QPA_PLATFORMTHEME=qt5ct
If there is no output, the variable isn't set. To do a quick test, just define the variable in your shell's interactive session, then launch qpdfview from that same session. You should see this output, confirming that qt5ct is active:
$ qpdfview
using qt5ct plugin
If the style still doesn't look right, make sure "gtk2" is the selected style within qt5ct itself.
That's exactly what my computer does when it's out of RAM (or close to it). Even the audio thing. It's shocking to me that this problem isn't more widely reported. It was very frustrating for me until I figured out a solution. With the following steps, I no longer have to restart my computer after it freezes due to high RAM usage:
Make sure this is actually the root cause of your problem:
Problem:
Workaround:
Solution:
htopand watch for programs that use a ton of RAM (look at the MEM% or RES column). If you notice you're approaching max memory usage, kill offending processes. (Probably your web browser or other desktop applications... I wouldn't kill anything you don't understand.) This is the manual solution. Keep reading for a more systematic solution.GNOME has deprecated tray icons in GTK+ itself (GtkStatusIcon): https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html
Reason:
I recently discovered this while writing a GTK application...absolutely maddening.
That's not what "bricked" means.
The most reliable way, I've found, is Xorg.conf. It offers a lot of options to customize mouse acceleration.
All the options are explained in the Xorg.conf manpage. Definitely read this over and keep it open as a reference. It will take a lot of experimenting to find the right settings. Here are my thoughts:
If you're referring to the general pointer speed, even before acceleration, ConstantDeceleration can solve this. For example, if your pointer is extremely fast all the time, setting ConstantDeceleration to 2 will cut the speed in half. This speed decrease is applied 100% of the time, unrelated to acceleration.
AccelerationProfile is relevant here. It basically defines the "curve" of the acceleration. AccelerationNumerator and AccelerationDenominator are also relevant. They define the acceleration factor as a fraction. Low factor means that acceleration doesn't effect the overall speed that much, compared to zero acceleration.
Once you have those settings tweaked, you can fine-tune it with these next two. AdaptiveDeceleration and AccelerationThreshold are useful for allowing small, precise movements without acceleration going crazy. AccelerationThreshold is simple: if the pointer speed is below this value, acceleration will never activate. AdaptiveDeceleration will actively decelerate the pointer when it's moving slowly.
Good luck!
It was explained very simply in the post:
OP mentions programs like OneNote and LibreOffice, so it's pretty clear they don't want a keyboard-centric text editor to complement their touchscreen...
Haswell i7. I had
-march=native -mtune=nativein myCFLAGS, and Firefox 54 compiled successfully on GCC 7.1.1 after removing both flags.Thank you!! I was just starting to waste a lot of time digging into this...
Agreed. I despise mailing lists. If a good web interface existed, it might be tolerable. But there isn't.
I recently solved this. Firefox doesn't select fonts like other desktop applications. Here's how to make Firefox recognize system fonts:
userChrome.css. This is in your profile directory (~/.mozilla/firefox/<PROFILE_ID>) underchrome/userChrome.css. Create this directory and file, if they don't already exist.This font will now be available to Firefox; for both Firefox' native UI and for web pages. Repeat this for every font.
Thanks for the info!
I noticed the exact same thing with vifm after updating to
ncurses 6.0+20170401-1. Rows were colored randomly every time I moved the row selection. Downgrading toncurses 6.0+20170128-1fixed the issue.CaitSith. It's a new MAC system by the author of Tomoyo. It doesn't need a patched kernel or patched packages. If you want to use network policy rules (control socket usage, etc), you need to recompile the kernel with
CONFIG_SECURITY_NETWORKenabled, but that's optional. I've been running it for about 9 months, and it's been rock solid.Kernel module (AUR): caitsith-lkm
Userspace tools (AUR): caitsith-tools
I don't know how it compares to grsec, but I find it perfect for a desktop system. It's a simple design, and very easy to write your own policies. For example, if we want to restrict access to
/usr/bin/dmesg. Let's say, only allow its execution for root, UID 1000, or if it's being invoked from zsh:That's it. Domains are easy to use as well. CaitSith can be used as both a blacklist and a whitelist. If you just want to protect one file, you can. You don't have to classify every file on your system. SELinux is far more comprehensive, but also more complex (and, for Arch users, a hassle to rebuild everything with audit/SELinux support).
I assume it was removed from the repos because extra/polkit no longer needs js17.
Here's a command pipeline to list AUR and local non-AUR packages which:
/usr/lib/python3.5These commands depend on
package-query. This one will show which repository (AUR or local) each package belongs to:This one will only show the package name:
After upgrading to Python 3.6, you'll need to rebuild every package in the list.
I recently started using pacman-ps. It works in a similar way, except it handles all processes, not just systemd services. It shows the path of the upgraded file, the process using/referencing it, and the pacman package which owns it. I highly recommend it!
Make sure that the "gtk2" style is selected within the qt5ct tool itself. Also make sure that native GTK2 programs are showing the correct theme, because Qt doesn't use GTK3. If that doesn't work, try a different theme. Beyond that, I don't have any more advice. Qt 5.8 will hopefully include native GTK3 support, but I'm not sure when it will be ready for release.
I have it placed in my
.xinitrc. Open your shell and check the output of this command:If there is no output, the variable isn't set. To do a quick test, just define the variable in your shell's interactive session, then launch qpdfview from that same session. You should see this output, confirming that qt5ct is active:
If the style still doesn't look right, make sure "gtk2" is the selected style within qt5ct itself.
Make sure you have this environment variable set:
export QT_QPA_PLATFORMTHEME=qt5ctHe made a mistake, so what? A lot of people forget to check the homepage.
dtrx looks awesome.
End of this list.
Back to top