Again, it does not necessary have to be something installed recently. It could have been installed a long time ago, if you been progressively updating the same system over time. It may have been for an accessory (or an app) you no longer use. The latest OS X update caused an incompatibility. (And it could be malware, which by design is not something you knowingly installed.)
Here are two other tests you can try, for narrowing down the cause:
- Create a new user account in System Preferences Users & Groups pane. I have a Test User account for trouble-shooting and other testing. The new user account can be Standard (not Administrator). Log out of your usual user account and log in to the new user account. Do not use Fast User Switching for this test. In the new user account, do the things that cause this problem. If the problem does not occur in the new user account, the cause is likely to be something in your usual user account. For example, it may be a background process that starts automatically when you log in. If the problem occurs in the new user account, then cause is something at the system level (or maybe hardware-related). Either way, you can better focus your trouble-shooting (instead of trying "random stuff").
- If you have an external drive that you can erase, you can install a fresh OS X system on it. I use an SD card in my Mac's high-speed SD card slot as an alternate startup disk for testing. You can get good-quality 64GB "SDXC" cards for less than $20 these days. It needs to be re-initialized (erased) using Disk Utility to reformat it for Mac. Then, it acts like an external drive, and you can install an OS X system on it. Surprisingly fast. Or you can use an external USB hard drive. USB flash drive may or may not work well, depending on speed. 32GB or more is large enough to install and efficiently run an OS X system (64GB is better if you want to install additional software on it).
Run the clean test system and do the things that cause this problem. If the problem does not occur, the cause is somewhere on your normal OS X system. If the problem does occur, then it's a hardware problem or it may actually be a "bug."