Pycharm 2019.3 runs VERY slow and takes forever to finish - debugging

I have been using Pycharm 2019.3 with Python 3.6 as the interpreter and haven't had any issues until recently. The problem that I am having is that when I run a python script it takes a long time to finish. When I tried to stop the running script it takes about 5 minutes to fully terminate (stop) so I can run it again. Also, when I "terminate" the script I get a loading window saying "waiting for process to detach" and it takes 5 minutes, after that I can run the script and it runs fine but then again takes a long time to stop terminate completely so it can run again. It's frustrating since I need to run the scrip many times and I have to wait 5 min every time to re-run it :(
My configuration: Ubuntu 18.04 LTS with 16GB RAM
Any help is much appreciate it!
Thank you.

It looks like some other individuals have had similar issues with the console needing to be re-run when the stop button is used in Pycharm. Another person claims that they have to click stop twice on Ubuntu in order to get a process to terminate.
It seems like problems with terminating processes in Pycharm and other JetBrains products have been a long-standing issue that is hard to fix. Beyond, reinstalling Pycharm and possibly reinstalling your Python interpreter, this issue might just unavoidable with your specific hardware/os configuration.

Related

Longshot: Python and PyTorch not running unless I bump my GPU to run by doing some other task

Longshot, but anyone had this issue?
I have code running (or not) which is set to run on the GPU. It fails to run unless I bump the GPU to make it run a little bit, for example by watching YouTube or playing a game.
I believe there may be some computer resource/application prioritisation/limitation configurations causing vscode to stop running, and wondered if anyone else had run into this issue.
I am running the code in a .ipynb notebook file in vscode (not sure if that might contribute to the issue). Sometimes the code will just freeze permanently, and I usually go about restarting the code to get things going properly.
The code should normally takes about 7 seconds for the training epoch, and 0.7 seconds for the validation epoch. But I was away for the first epoch and found it hadn't started, and so I opened up Youtube and it began.
Code timings
I can't think of what settings to change for this, but have tried a few
Power options
Anyone had a similar issue before? My second theory is that I think perhaps I am using too much GPU ram in my python code which is slowing it down and effectively made it freeze. And then when I load another application to use the GPU it forces the GPU ram to reconfigure and somehow this RAM reconfiguring might be unblocking the GPU allowing it to run again.

Diagnosing Windows program that hangs on startup

I have a new Win10 laptop. I've installed lots of software, including a 25-year-old Codewright editor that I've customized up the wazoo, and that I've been installing on all my machines for, well, 25 years. After working for a few days, it suddenly stopped, and reinstalling it didn't fix it. On startup, it puts up a small splash window, and normally opens the main window a half a second later (that took more than 5 seconds 25 years ago). It's not using any CPU, and there's nothing I can do but kill the process.
In the past, I've occasionally got my system into a state where Codewright would hang on loading, due to some other program that hadn't terminated correctly, and it was unfrozen by killing off that other process. So that's reason to believe that Codewright is waiting at some global lock which some other malfunctioning software is holding. So I have two questions:
Does this ring a bell? Is there some known failure mode where a program putting up a splash window then switching to another window can be prevented by something else going on the system?
Is there a way to diagnose this, perhaps by finding out what system call it's hanging inside? I tried dtrace.exe, started Codewright, and then stopped tracing, and it produced a 3GB XML file, which is quite a haystack. There's a way to filter it by PID, but since this is a startup problem, I have no idea what the PID will be. Is there a better tool for doing this, or some more appropriate dtrace feature that I missed?
The comment about using the Task Manager to create a dump file actually led me to notice that there is an Analyze Wait Chain function there that I had never seen before, since I haven't used Task Manager much since I switched from Win7. This gave me exactly the answer I wanted. My editor was waiting for something that was being held by some NVIDIA GeForce Experience module. Since I don't use that, I uninstalled it, and I'm back up and running. Thanks for the tip.

PDB debugger stability questions

I am using either pdb or ipdb for debugging my python code. However whenever I am using set_trace() I can typically run a handful of lines of code to test but it eventually freezes while I am typing. I kill the python process and have to re-run the entire process from the start - which usually kills about 5-10 minutes of data processing time to get back to where I was.
I am using an anaconda build with python 2.7.
The only anomaly I have is that I needed to run
conda install -c conda-forge psycopg2=2.6.2 in order to be able to use psycopg2. I have been ignoring it for the last two months but realize that it isn't an acceptable work flow.
Any thoughts to help resolve would be appreciated.
Resolved it.
I still don't know why this behavior is happening but if I press caps lock twice while it is frozen - it unlocks the set_trace. Don't ask me why but it works.

Long Start-up Time for GNU Octave

On a clean installation of Octave 3.6.4 for Windows MinGW on a Windows 7 machine, octave takes around 30 seconds to start every time. From what I have seen elsewhere, this is far from normal.
By "take 30 seconds to start" I mean from the time that I enter octave on the command line or initialize the octave.exe executable, it takes consistently 30 seconds to give the octave:1> prompt. Otherwise, it runs quite quickly, start-up is just agonizingly slow.
Something possibly relevant is that when watching resource manager, the octave process first peaks quickly in CPU usage as soon as it is called, then totally disappears in terms of CPU usage, than peaks again as it finally comes up.
I have searched for any other instances of this happening, and was unable to find any. This happens without loading any packages.
I'm guessing that your command prompt is starting octave at a very slow rate. Personally, I prefer using Console2 as an enhancement for the command prompt as you can set a path of the octave.exe and have it automatically load up in the window once you start Console2. It also gives you other additional features. This might or might not fix your slow start problem but I think it's worth a try:
http://robertcorvus.com/how-to-run-octave-in-console2/

Experiencing freeze during OpenCMS setup

Anyone ever experienced something like that? I'm installing OpenCMS 8.5.0. for evaluation, running on Tomcat 7x, and during the 8th step of setup (Installing Modules), the process freezes - I've got stuck for a long time in a same line (I left it the way it was, and hung out for coffee for 30-40 minutes), without any update.
What have you done?
Thanks,
*** Edited from this line ***
I've tried to refresh the page (After coming back from my coffee break), and it only cleared the logs. So I stopped the server and re-started it again. The process started from beginning (I had to drop the database and create it again), the processes freezes again, I waited some time, a tried to refresh the page sometimes, again I faced logs inside the 'textarea' the being cleared, after some tries, the process was finally finished.
Anyone have faced the same experience?
Things to check:
How much max. heap is assigned to the Tomcat? 64MB as the default standard? Eventually tried to increase that parameter?
Can ou check the log (WEB-INF/logs/opencms.log) or the catalina.out - do you see any errors in there?
I have OpenCms 8.5 running on Tomcat7 without any problems.
Which OS are you on? Windows, Linux, Mac?

Resources