Java Concurrency - Process (Main thread)

> Procedural Languages > Java > Java - Concurrency (Parallel Work)

1 - About

process in Java

A process in Java is:

  • started by a main class.
  • implemented as a main thread that can create other thread.

It has:

  • a self-contained execution environment.
  • a complete, private set of basic run-time resources; in particular, each process has its own memory space.
Advertising

3 - Management

3.1 - Creation

Most implementations of the Java virtual machine run as a single process. A Java application can create additional processes using a ProcessBuilder object.

3.2 - List

Java Virtual Machine Process Status Tool.

The jps command will report the local VM identifier, or lvmid for each instrumented JVM found on the target system (The lvmid is generally the operating system's process identifier).

  • With package name
jps -l
15316 org.jetbrains.jps.cmdline.Launcher
23380
29380 sun.tools.jps.Jps
30308
27400
9064 org.jetbrains.jps.cmdline.Launcher
24060 com.intellij.rt.execution.junit.JUnitStarter
  • With argument
jps -lm
15316 org.jetbrains.jps.cmdline.Launcher C:/Idea2018/lib/jna-platform.jar;C:/Idea2018/lib/snappy-in-java-0.5.1.jar;C:/Idea2018/lib/maven-aether-provider-3.3.9-all.jar;C:/Idea2018/lib/trove4j.jar;C:/Idea2018/lib/util.jar;C:/Idea2018/lib/oro-2.0.8.jar;C:/Idea2018/lib/jgoodies-forms.jar;C:/Idea2018/lib/protobuf-java-3.0.0.jar;C:/Idea2018/lib/guava-21.0.jar;C:/Idea2018/lib/slf4j-api-1.7.10.jar;C:/Idea2018/lib/httpclient-4.5.2.jar;C:/Idea2018/lib/idea_rt.jar;C:/Idea2018/lib/jps-builders-6.jar;C:/Idea2018/lib/aether-dependency-resolver.jar;C:/Idea2018/lib/jdom.jar;C:/Idea2018/lib/jna.jar;C:/Idea2018/lib/jps-model.jar;C:/Idea2018/lib/commons-logging-1.2.jar;C:/Idea2018/lib/nanoxml-2.2.3.jar;C:/Idea2018/lib/log4j.jar;C:/Idea2018/lib/annotations.jar;C:/Idea2018/lib/jps-builders.jar;C:/Idea2018/lib/resources_en.jar;C:/Idea2018/lib/netty-all-4.1.13.Final.jar;C:/Idea2018/lib/aether-1.1.0-all.jar;C:/Idea2018/lib/javac2.jar;C:/Idea2018/lib/httpcore-4.4.5.jar;C:/Idea2018/lib/forms_rt.jar;C:/Idea2018/lib/platform-api.jar;C:/Idea20
23380
30308
27400
33448 sun.tools.jps.Jps -lm
9064 org.jetbrains.jps.cmdline.Launcher C:/Idea2018/lib/jna-platform.jar;C:/Idea2018/lib/snappy-in-java-0.5.1.jar;C:/Idea2018/lib/maven-aether-provider-3.3.9-all.jar;C:/Idea2018/lib/trove4j.jar;C:/Idea2018/lib/util.jar;C:/Idea2018/lib/oro-2.0.8.jar;C:/Idea2018/lib/jgoodies-forms.jar;C:/Idea2018/lib/protobuf-java-3.0.0.jar;C:/Idea2018/lib/guava-21.0.jar;C:/Idea2018/lib/slf4j-api-1.7.10.jar;C:/Idea2018/lib/httpclient-4.5.2.jar;C:/Idea2018/lib/idea_rt.jar;C:/Idea2018/lib/jps-builders-6.jar;C:/Idea2018/lib/aether-dependency-resolver.jar;C:/Idea2018/lib/jdom.jar;C:/Idea2018/lib/jna.jar;C:/Idea2018/lib/jps-model.jar;C:/Idea2018/lib/commons-logging-1.2.jar;C:/Idea2018/lib/nanoxml-2.2.3.jar;C:/Idea2018/lib/log4j.jar;C:/Idea2018/lib/annotations.jar;C:/Idea2018/lib/jps-builders.jar;C:/Idea2018/lib/resources_en.jar;C:/Idea2018/lib/netty-all-4.1.13.Final.jar;C:/Idea2018/lib/aether-1.1.0-all.jar;C:/Idea2018/lib/javac2.jar;C:/Idea2018/lib/httpcore-4.4.5.jar;C:/Idea2018/lib/forms_rt.jar;C:/Idea2018/lib/platform-api.jar;C:/Idea20
24060 com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 net.whatever.db.sample.tpcdsTest,loadAllTables