Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:12:04+00:00 2026-05-13T15:12:04+00:00

I have a java process currently running under a windows shell. One of the

  • 0

I have a java process currently running under a windows shell.

One of the threads responsible for serialisation is blocked indefinitely and as a result important information which is stored in memory is no longer being written to disk.

If I shutdown the process, the information will be lost.

It would be convenient if I could write and compile some new code and have it execute in the same memory space so that the said information could be serialised once more before I shutdown the process.

The process was started using a java -jar command.

With the hotspot VM features, is there any way to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:12:04+00:00Added an answer on May 13, 2026 at 3:12 pm

    You can use the Attach API to attach to a virtual machine. Here’s an article that explains how to use it

    Here’s a code example:

    String agentJAR = "myAgent.jar";
    VirtualMachine vm = VirtualMachine.attach (processid);
    vm.loadAgent(agentJAR);
    

    Where the agent is the name of your jar.

    The agent jar contains an Agent, which can interface with the JVM using the Instrumentation API.

    To create an agent that gets loaded at runtime, you implement an agentmain function like this:

    public static void agentmain(String agentArgs, Instrumentation inst); 
    

    or

    public static void agentmain(String agentArgs); 
    

    The Instrumentation object is used to modify classes at runtime, which you probably don’t need. But hopefully you can just put whatever code you need to run in agentmain and then use the attach API to run it in the target JVM.

    Good luck!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use: SELECT p.id as a, p.url as b, t.id as… May 17, 2026 at 3:22 am
  • Editorial Team
    Editorial Team added an answer There are two parts to the problem First Issue You… May 17, 2026 at 3:19 am
  • Editorial Team
    Editorial Team added an answer I thought I'd show the regex approach, too. It doesn't… May 17, 2026 at 3:18 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Java process that opens a file using a FileReader. How can
I have a Java method which starts up a Process with ProcessBuilder, and pipes
If you have a java.io.InputStream object, how should you process that object and produce
If I start a process via Java's ProcessBuilder class, I have full access to
I have Java and Flash client applications. What is the best way for the
Here is what I have: JAVA_HOME=C:\Software\Java\jdk1.5.0_12 (points to JDK 5.0) In Eclipse Installed Runtimes
Does Java have a built-in way to escape arbitrary text so that it can
Does Java have a data type that represents a period of time eg 34
Does Java have buffer overflows? If yes can you give me scenarios?
I have done Java and JSP programming in the past, but I am new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.