Visual Studio Code - lagging when typing - java

I have just installed Visual Studio Code together with the Java Extension Pack. However, when I opened my first file and started typing, the text I type appears after a delay - reaching up even one second.
I have a hunch that it might be due to the number of processes going behind the editor, like real-time syntax checking, autocompletion, code hints et cetera. Perhaps the laptop I am working at simply cannot handle that much. These are the parameters of my current machine:
Processor: Intel(R) Caleron(R) CPU N3350 (1.10 GHz)
RAM: 4 GB
I have another hunch that it may be due to the processor.
So, are there a ways to switch off these facilities like real-time error-checking? If not, what other IDEs for Java could you reccomend? (Apart from Eclipse)

Had the same problem using Visual Studio Code while using Android Studio along with an Android Simulator in the background, and I run 8GB RAM and a CPU of 3.2GHz but when I returned to Notepad++ (I know its suicidal), to check if it is my problem or because of the IDEs, I typed in real time.
It is due to your processor as Visual Studio Code is not really recommended for "slow" CPUs. Personally I like it, although an IDE in the likes of Vim might suit you better.
Here is a link that might give some more hints:
https://github.com/Microsoft/vscode/issues/38409

The easiest solution I found was to download and install Visual Studio Code Insiders. It's nearly identical except that it's known to lag less. Installing this will also clear any extensions or preferences you have enabled which might be causing the lag:
https://code.visualstudio.com/insiders/
You may also need to run it from the command line with the --disable-gpu flag
code-insiders --disable-gpu
or
/Applications/Visual\ Studio\ Code\ -\ Insiders.app/Contents/MacOS/Electron --disable-gpu
depending on your OS

Try the following steps:
Disable any unnecessary extensions.
Update to the stable version.
If this still hasn't worked, try reinstalling your Visual Studio Code instance.

Same for me, I often let the computer sleep instead of turn off and kill all processes so it was normal for me that the VS was open for a few days, the solution was to close visual studio and reopen it.

maybe its the computer performance issue. i am using a laptop.
yesterday i uninstall large program (MS SQl server)
now typing speed back to normal.

I've now had this problem a number of times. As a matter of fact I just had it right now.
What solves it for me is to
Close VS code
Unpin it from my taskbar
Pin it back
It works well after that.
Closing and reopening VS Code has never worked for me

Please disable Spring Boot Tools from Pivotal!!!
This extension doesn't work well with other Java extesions.(ie. Extesion pack for Java and Language support for Java)
After disabling it, I've seen significant speed increase with Intellisense, and CPU load reduced as a result. Please get rid of the thing!!!

Related

LWJGL GLFW hangs on native glfwInit call

I originally posted this question on GameDev stackexchange however I'll also ask the question here to try and get more outreach, especially since I wasn't sure my problem was specific to game development since it's a problem with a Java native call.
For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as much as I can while building it. Only recently there has been strange behavior happening when I launch the engine from IntelliJ for testing:
After about 6-10 individual times I click run, all subsequent runs suddenly take about 60 seconds for the window to appear.
Whenever I restart my PC this hanging resets and I have another 6-10 runs before it hangs everytime again.
I located the issue to glfwInit, more specifically at the call to the native method:
#NativeType("int")
public static boolean glfwInit() {
long __functionAddress = Functions.Init;
return invokeI(__functionAddress) != 0; // Right here
}
I also noticed that this issue only started when I attempted to implement text support in my engine using the STBTrueType library. It was perfectly fine before that. I tried removing the TrueType code but it didn't fix it.
Here's a list of things I've tried:
Clearing my temp folder in case a buggy or corrupted file was present.
Recompiling and rebuilding the entire LWJGL jars twice.
Building glfw.dll from the GLFW sources and replacing the glfw.dll in the native jars with the former.
Reinstalling Java and actually upgrading JDK versions (from 13.0.2 to 14.0.2)
Switching IDEs even if I suspected it wouldn't work.
Updating my NVIDIA drivers, and reinstalling them.
I'm quite confused as to what it could be, and I'd be more than happy to share code, thread dumps, or debug info if you deem it necessary. Here is the Github repository with the latest, "faulty" code (fault in quotes because I'm not too sure the code is the problem.)
Thank you very much for any guidance.
P.S: Please tell me if this is better asked in StackOverflow instead of here.
So I fixed the issue, it turns out it wasn't even related to anything to do with programming, or STBTrueType, or the library itself. The problem was as pointed out in this StackOverflow post, where this hanging behavior was due to a faulty driver or, in my case, my keyboard USB being plugged in the "wrong" USB port. I moved my computer at the same time I started working on text in my engine, hence why I wrongly linked the issue with the TrueType library. If you're having the same issue, look at the aforementioned post or if that doesn't work, look for a peripheral that might cause interference.

Linux Version of Eclipse is freezing when trying to open binary files (with .bin extension)

I had tried opening binary files of size 32MB. Eclipse (in Linux version) is freezing and I'm unable to perform any other operations (because of this hang in the Eclipse product).
I'm not even able to run other processes (like Task manger to exit the Eclipse IDE) which forces me to re-boot the system.
It seems that there is a problem in a particular plugin that you are using in your product, and that it is affecting your users.
If the plugin developer isn't helping you, your options are limited:
You could "bug him" about it ... but this probably won't help.
You could offer him (or someone else) money to fix the problem.
You could try to find and fix the problem for yourself (assuming that the plugin is open source).
You could identify an alternative plugin with the functionality you require.
You could implement a replacement plugin yourself ... or pay someone else to do it.
From the technical perspective, I doubt that we can help you unless you explain in depth what the nature of the problem is, and what you have found. On the face of it, it sounds like a scalability issue; i.e. the plugin is using an SWT widget that does not work with huge files. If that is what the problem is, then the technical solution is probably to use the widget in a different way ... that avoids the issue.
Opening 30Mb binary files in an editor is kind of pathological.

Performance measuring

I wanted to know if there is a way to measure the overhead of a specific function or even the running time of an application in Eclipse (with the capability to run the test for arbitrary times to get the average time).
I have a code that should be executed in Eclipse therefore looking for such a thing. I know that we have Jmeter in Netbeans and I'm looking for something similar in Eclipse.
Thanks
I have had good experiences with JProfiler. It should be precise enough to give usable data even when you run your function only once, depending on how you set it up. It also optionally integrates with Eclipse.
It's not free, but there's a fully functioning trial available.
I used Traceview before and it worked quite good to me.
It quite easy to use, just open the DDMS view in eclipse and look for the icon with three arrows with a red dot (Start Method Profiling). Click the icon and test your app as you want. When you are done click on stop. The trace should open in a new tab.
You could use the following
http://www.jvmmonitor.org/
It's called Java Monitor and comes as an eclipse plugin. You can install it from eclipse market place.

Java IDE for working over Remote Desktop

I have recently found out that anything Swing(NetBeans, IDEA) is excruciatingly slow to paint the UI over Remote Desktop(RDP).
Can you guys give me any suggestion for something that will work properly over RDP?
Actually, contrary to everything I've seen - mostly the "Dsun.java2d.noddraw=true", which is mentioned in a number of places, it is actually setting it to false that fixed the drawing issues(for me at least). Go figure.
RDP is optimized for native Windows apps and, regrettably, newer versions of RCP (like Vista/Win7's default RDP) is even more hostile to non-native apps than older (XP/Server 2003) versions. Here's a good link:
http://devnet.jetbrains.net/thread/280673
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4204845
One workaround is to get a screaming fast CPU/graphics board, tons and tons of memory and a super high-speed network connection :)
Another is to:
Select "32-bit true color" in your Terminal Services settings
Select "Modem"
Reduce screen resolution (heck, use 1024x768 if possible)
Here are some additional tips:
http://www.codinghorror.com/blog/2006/04/remote-desktop-tips-and-tricks.html
Try setting "Dsun.java2d.noddraw=true"
http://ubuntuforums.org/archive/index.php/t-1129187.html
http://www.mindfiresolutions.com/Solving-DIRECT-DRAW-ddraw-problems-in-Java-Swing-730.php
I am launching a java swing application from Linux, and display it as a Windows frame thanks to MobaXterm.
If you haven't done it already, please have a look at the following documentation :
https://docs.oracle.com/javase/8/docs/technotes/guides/2d/flags.html
Using -Dsun.java2d.noddraw=true did not fixed my issue, but setting xrender to true did.
So here's the code I used on Linux :
export _JAVA_OPTIONS='-Dsun.java2d.xrender=true'
java -jar my_java_application.jar
Maybe it's not only Swing that paints slow over Remote Desktop. However, Eclipse is based on SWT, based on native widgets, so it is not Swing.
You should give JavaWIDE a try. It is an IDE designed for access to a JDK without it installed on a system, with a built-in storage system so you just need access to the internet. It's not exactly a program for accessing everything on the computer but it will do a good job with your programming. It may take a while however, as the compiling is done on a separate server.

VLC dying when called from inside Java

I'm having a problem that, at this moment, I don't even know how to investigate properly. Any recommendations on how I can get more information are welcome and appreciated.
My company sells a product with a WinXP PC at its core. One of the product's tasks is being able to start a video player on demand -- VLC, in this case. (To be specific, VLC 0.8.6d; it's several years out of date, but upgrading is problematic for a few reasons.) The application responsible for starting the player and performing many, many other tasks is written in Java.
I have a test rig sitting next to my desk. It used to work just fine. But for some reason, it now gives a "Send Error Report" window when the Java app tries to start VLC: "VLC media player has encountered a problem and needs to close...." You know the one.
Clearly, I've done something that buggered things up. Problem is, I know neither what it could be nor how I would go about fixing it.
Stuff I know:
It's not a code bug. I run the same software on my development desktop machine, and it doesn't have this issue.
It's not the VLC install, nor is it a malformed video file. When I capture the command used to start it from Java and manually enter that command from a "cmd" window, it works fine.
It's not that sneaky bastich bug where Java punishes you if you don't manually drain STDERR and STDOUT when making a system call. I've got that covered.
I'm not getting any error messages or output when it fails; it just fails and gives me that pop-up window.
I'm stumped. Recommendations for either what it could be or how I can figure out what it is are very welcome.
Well, I’m not familiar with java and VLC, but I would do the following things:
Check that you have identical java virtual machines in both of your desktops. Just in case…
Check the process’s environment variables. They depend on parent process. Maybe VLC uses some of them.
Try to debug crashing with native debugger like WinDbg. Perhaps the call stack will give you more ideas.
Good luck!
My suggestions:
Create a simple java app that just launches VLC
Use your app to launch a simple command line windows program
Use your app to launch a complex program
Check to see if there is a memory constraint issue. Is VLC getting too little memory to run?
This really sounds like a memory/environment issue.
A number of things I would try
Make Sure both test and development machines are identical in every respect, the operating syste(if possible installed from same OS Disk), same JVM version, same memory allocation to JVM (you know those -X-ms stuffs). My fear is not with Java/JVM per se, it is with windows.
Make sure you can lunch for example Notepad from a Java app, and then something like Windows Media Player or MS Word.
Try and launch other versions of VLC to see if it is a VLC version problem.
Finally try and wipe the test box and re-install it(with Windows, you can never tell, a fresh installation might just do it!!)

Categories