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 311k
  • Answers 311k
  • 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 For a start, deliminator would probably be delimiter, although I… May 13, 2026 at 10:27 pm
  • Editorial Team
    Editorial Team added an answer 1) Since you already wrote your own from scratch I… May 13, 2026 at 10:27 pm
  • Editorial Team
    Editorial Team added an answer The thread should stay alive until its method(s) return. Check… May 13, 2026 at 10:27 pm

Related Questions

I'm looking for a straightforward Java workflow engine that: can handle both automated and
How do I set environment variables from Java? I see that I can do
I currently have a tomcat container -- servlet running on it listening for requests.
I have been having some trouble figuring out how exactly I get a process's
I am administrating a small, private website with 100% trusted users (about 60 people,

Trending Tags

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

Top Members

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.