Re-creating threading and concurrency knowledge in increasingly popular languages

I am primarily a Java developer, and I've been reading a lot of in-depth work on threads and concurrency. Many very smart people (Doug Lea, Brian Goetz, etc) have authored books on these topics...

Log4J: Strategies for creating Logger instances

I decided to use Log4J logging framework for a new Java project. I am wondering what strategy should I use for creating/managing Logger instances and why? one instance of Logger per class e.g. ...

Impossible to make a cached thread pool with a size limit?

It seems to be impossible to make a cached thread pool with a limit to the number of threads that it can create. Here is how static Executors.newCachedThreadPool is implemented in the standard...

what's this file in java? core.26416, heap dump or thread dump?

core.26416 ,what's this file in java? which tool can anaylst it? what's the extension for java thread dump , heap dump and core? what's the difference between thread dump/heap dump and core dump?

Synchronized and the scope of visibility

I've been reading up on Java concurrency and had forgot the fact that synchronization blocks in two threads using the same lock also affect the visibility of variables, even though they were not...

How is CountDownLatch used in Java Multithreading?

Can someone help me to understand what Java CountDownLatch is and when to use it? I don't have a very clear idea of how this program works. As I understand all three threads start at once and each...

Change Jetty default port

Jetty default port is 8080, but I want to change to default port to some other port (9999). I read a few tutorials and they said almost all of configuration information is by default maintained in...

What is a safe way to create a Temp file in Java?

I'm looking for a safe way to create a temp file in Java. By safe, I mean the following: Name should be unique, even under potential race conditions (e.g. another Thread calls the same func at...

Multiple Rest calls in Java using RestAssured

When you make a rest request using RestAssured, it appears to wait for a response. I need to make a POST request in RestAssured and then while it waits for a response, I need to make a GET...

Exception in monitor thread while connecting to server localhost:27017 while accessing MongoDB with Java

I have the following exception when running Java app for MongoDB: [localhost:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server localhost:27017 while...

A RealmObject with no @PrimaryKey cannot be updated

I am currently refactoring some old app and I am trying to migrate from SQLite to Realm. I have used Realm before and I have never encountered problem like this. When I start my app for first time...

Why is Internal memory in java Native Memory Tracking increasing

My application is running in a docker container, it use scala and use "OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)", its Xmx is set to be 16GB and container memory limit is 24Gb, after...

error java.lang.NoSuchMethodError in java-mongodb example

I have been trying to execute my first mongodb example in java. Its showing me the error. I have installed everything properly. Any help would be appreciated.it is throwing an exception Exception...

Threads are going to be renewed over time to try and avoid a probable memory leak

I try to deploy my war file. But after success deployment. I get this log: [[email protected] bin]# export JAVA_HOME="/usr/java/jdk1.8.0_112/" [[email protected]]# ./startup.sh Using CATALINA_BASE: ...

Gradle NoClassDefFoundError when running jar

I'm trying to set up a Gradle project with some Velocity functions in it. So far I have the following files: **src/main/java/com/veltes/velotest.java:** package com.veltes; import...

cucumber.json report getting overwritten by rerun scenario report

I have got UI Test project and a API test project with same technology stack (JAVA1.8, Cucumber-JVM, JUnit, Maven) and both projects are showing me this problem. Probably because same set of...

Java - Internal Native Memory usage is too high

What is the Internal Native Memory in Java, and how can i limit it? I'am using the one of popular java application, like tomcat, but i have problem with very high memory usage, after few hours. I...

How to distinguish RUNNING state from java.lang.Thread.State.RUNNABLE in Java

When a thread is RUNNABLE, it can be running, or be not. Is there a way to distinguish it from java.lang.Thread.State#RUNNABLE? All states of threads in Java doc: java.lang public class...

Kivy's 3D rendering (monkey rotation) apk crashes on start

Versions: Python: python3 OS: Android Kivy: v1.11.1 Kivy installation method: buildozer I took Kivy's example 3D Rendering (rotation monkey head) app, on Linux(Ubuntu) and Windows 7 application...

Unable to Create many threads in OCP Containers

Recently we were getting the following exception in one of our Containers which was running a Java application in Openshift 4.2. This container used to run perfectly on Openshift 3.11. Exception...

Java scheduleAtFixedRate + Thread.sleep

I'm just exploring method scheduleAtFixedRate of class ScheduledExecutorService in Java. Here is my suspicious code: ScheduledExecutorService scheduledExecutorService =...

How to write web.xml and persistence.xml to connect Java EE to DB Server

I aim something very simple - create an empty maven, download in pom - javaee-api, and then to connect this simple maven EE project - to DataBase Server - currently my local machine's MySLQ...

Know number of threads running in apache beam direct runner

I have an apache beam program in java running with direct runner. Apache beam uses threads in order to achieve distributed processing. At run time how can I know the number of threads spawned by...

Gradle test fails using the JaCoCo plugin with Java 15?

This problem appears to be mentioned in https://github.com/gradle/gradle/issues/15038, but it is unclear from that thread how to fix it so posting it here. I'm running Java 15: > java...

How to make ThreadPoolTaskExecutor access request scoped bean in Spring Boot

I have list of items to be processed seperately. So, I wanted to use Java parallel stream but threads did not able to access my request scoped bean. I tried the below implementation: @Bean(name =...

Java outputs a Full Thread Dump every few seconds when running from IntelliJ and given network sniffing permissions with setcap

I am writing an application that does packet sniffing using a Pcap library. For that to work, I need to give the java binary network sniffing capabilities to avoid having to run it as root: sudo...

H2 database DbException - Unsupported connection setting "MULTI_THREADED"

Recently, I upgraded the ignite version to 2.10.0. This needs the upgrade on H2 database as well because H2 has a hard dependency on ignite. So I updated the H2 database to 1.4.200. Since then my...

Error about Android Studio on Macbook M1: An error occurred while trying to compute required packages

I've downloaded Android Studio from the official website, the one for M1 chip (arm). Basically running it for the first time, the error is the following: An error occurred while trying to compute...

Java update from 11.0.11 to 11.0.13 changes JVM code cache behavior and results in more process cpu usage and strange profiled nmethods memory usage

We run a complex clustered application with Java 11.0.11 and -XX:ReservedCodeCacheSize=375m with the same load profile attached 24/7 without any restarts. After we updated AdoptOpenJDK...

is volatile HashMap enough for single writer multiple readers in java?

only one thread will call reload() at a time. I want to ensure that at any time, callers of get will see the content of the same latest map instance. Pardon me for my vague descrition on...