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 6656045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:35:41+00:00 2026-05-26T01:35:41+00:00

I know it is possible to write and read directly to memory by using

  • 0

I know it is possible to write and read directly to memory by using Unsafe class within the jvm.

Apart from this being really unsafe and somehow counterproductive, I was instead wondering who/what is taking charge of checking the boundaries of the allowed memory location.
And also if there’s some mechanism that safeguard the already allocated memory to be overwritten.
Related to this latest question, what possible damage can one does by overwriting what he shouldn’t ? Well, this could be best reformed as: what type of memory is the one that can be written, or what kind of information are already stored in there ?

Thanks

  • 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-26T01:35:42+00:00Added an answer on May 26, 2026 at 1:35 am

    The underlying operating system will ensure that you do not write outside of the memory allocated to your application (which it can do easily, due to Virtual Memory). If you do, you will get a segmentation fault or similar error In addition to that, the JVM might do its own bound checking. You’ll definitely not be allowed to write in any sensible (i.e. other applications) memory, and I doubt the JVM will allow you to overwrite internal structures, but I might be wrong there. So to summarize the answer to your question: The possible damage to overwriting where you shouldn’t is in the best case your application malfunctioning and in the worst case the JVM crashing.

    In regards to safeguards, not using Unsafe would be a pretty good one… Other than that, you can of course write your own memory allocator inside the memory allocated by Unsafe and flag some areas so your application code does not write into areas it shouldn’t.

    So the answer to your last question would be that if the JVM allows you to access memory outside of the allocated unsafe regions, then the information and type of memory you can access is any of your objects as well as any internal JVM structure. Obviously changing those would wreak havoc, so it’s likely that attempting to do so would result in a crash.

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

Sidebar

Related Questions

I want to know is it possible to read/write google spreadsheets using GET/POST methods
Does anyone know a good C++ class to read (and possibly also write) INI
I know its possible to open an app from mobile safari using custom URL
Is it possible to read/write from/to a specific USB port, avoiding all that USB
Within a VB.NET program, I want to read files from a filesystem, then write
I know it's possible to read in values from the grails-app/conf/Config.groovy but i was
Does anybody know if its possible to write a barcode scanning application for the
Anyone know if it is possible to write an app that uses the Java
Is there a good way to allow only a certain class to have read/write
I have a base class, FooBase. On it are a few standard read/write properties.

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.