Comments (10)
Hi there, it's same error than #4 ?
from aw-watcher-jetbrains.
@OlivierMary I didn't notice any exception like that, but I need to re-enable the plugin today for some work, so I'll keep an eye out and post again if I see it, or anything else that is new.
from aw-watcher-jetbrains.
I just saw this error, but I haven't had any more issues with memory or sluggishness.
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.base/java.util.ArrayList$Itr.next(Unknown Source)
at fr.mary.olivier.aw.watcher.ReportActivity.sendAllEvents(ReportActivity.java:192)
at fr.mary.olivier.aw.watcher.ReportActivity.lambda$addAndSendEvent$2(ReportActivity.java:180)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
from aw-watcher-jetbrains.
Any steps to reproduce it ? Nobody can tell me how to reproduce, I tried many stress test while using IDEA and never had this error..
from aw-watcher-jetbrains.
Sorry, but I can't seem to reliably reproduce any of the issues. Sometimes I use PyCharm and Webstorm at the same time. Is it possible that that is impacting it?
from aw-watcher-jetbrains.
While I don't know the cause of the CPU and memory usage, I do have an idea about why the exception is thrown. Here is a stripped down version of the important code:
public static void addAndSendEvent( ... ) {
ApplicationManager.getApplication().executeOnPooledThread(() -> {
Event event = new Event( ... );
getEventsToSend().add(event);
sendAllEvents();
});
}
private static synchronized void sendAllEvents() {
for (Event event : getEventsToSend()) {
// send the event
}
}
private static synchronized List<Event> getEventsToSend() {
return eventsToSend;
}
Imagine the following scenario:
- Thread 1 enters
addAndSendEvents
. - A new thread is born, call it thread 2. It adds an event to the list and starts running the for loop.
- Thread 1 goes on to do other things.
- After a while thread 1 runs
addAndSendEvents
again. - A new thread is born, call it thread 3. It adds an event to the list, but since thread 1 is still running the for loop, thread 3 cannot enter
sendAllEvents
. It waits. - Thread 1 tries to run the next iteration of the for loop, but the list is modified and the exception is thrown.
The fact that ´getEventsToSend´ is synchronized doesn't really do much.
The solution? You can synchronize on the list, like this:
synchronize (eventsToSend) {
// do things on the list
}
// other code
synchronize (eventsToSend) {
// do other things on the list
}
If a thread is running one of these clauses, the other clause cannot be run and has to wait.
Hope this helps.
Have a nice day!
from aw-watcher-jetbrains.
@Martomate thanks will look at this !
from aw-watcher-jetbrains.
I post a new version 1.0.8 tell me if problem is solved. You can DL it from release page on github or wait 2-3d on Jetbrains plugins
from aw-watcher-jetbrains.
It seems to be solved. I haven't seen the error since your fix :)
from aw-watcher-jetbrains.
Great ! I close it :)
from aw-watcher-jetbrains.
Related Issues (18)
- Watcher keeps watching even after IDE is closed HOT 3
- Unknown timezone HOT 6
- Can't find server HOT 6
- Miscategorizing C as ObjectiveC HOT 5
- Configure activity watcher server url
- Track used GIT branches
- Compatibility with Android Studio 3.2.1 HOT 4
- Plugin tracks Workspace.xml HOT 4
- Multiple exceptions caused by infinity loops HOT 6
- Allow to track current branch and commit HOT 2
- Considering not taking background time into account? HOT 8
- Event reaches future HOT 2
- IntelliJ reports exception HOT 45
- Exception after IntelliJ IDEA upgraded to version 2019.3.2 HOT 4
- Enormous amount of logged time HOT 6
- Stackoverflow error HOT 3
- How it works? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aw-watcher-jetbrains.