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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:12:39+00:00 2026-06-18T13:12:39+00:00

Background: I have a Java application which does intensive IO on quite large memory

  • 0

Background:

I have a Java application which does intensive IO on quite large
memory mapped files (> 500 MB). The program reads data, writes data,
and sometimes does both.

All read/write functions have similar computation complexity.

I benchmarked the IO layer of the program and noticed strange
performance characteristics of memory mapped files:

  • It performs 90k reads per second (read 1KB every iteration at random position)
  • It performs 38k writes per second (write 1KB every iteration sequentially)
  • It performs 43k writes per second (write 4 bytes every iteration at random position)
  • It performs only 9k read/write combined operation per second (read 12 bytes then write 1KB every iteration, at random position)

The programs on 64-bit JDK 1.7, Linux 3.4.

The machine is an ordinary Intel PC with 8 threads CPU and 4GB physical memory. Only 1 GB was assigned to JVM heap when conducting the benchmark.

If more details are needed, here is the benchmark code: https://github.com/HouzuoGuo/Aurinko2/blob/master/src/test/scala/storage/Benchmark.scala

And here is the implementation of the above read, write, read/write functions: https://github.com/HouzuoGuo/Aurinko2/blob/master/src/main/scala/aurinko2/storage/Collection.scala

So my questions are:

  • Given fixed file size and memory size, what factors affect memory mapped file random read performance?
  • Given fixed file size and memory size, what factors affect memory mapped file random write performance?
  • How do I explain the benchmark result of read/write combined operation? (I was expecting it to perform over 20K iterations per second).

Thank you.

  • 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-06-18T13:12:40+00:00Added an answer on June 18, 2026 at 1:12 pm

    The memory mapped file performance depends on disk performance, file system type, free memory available for file system cache and read/write block size. The page size on the linux is 4K. So you should expect most performance with 4k read/writes. An access at random position causes page fault if page is not mapped and will pull a new page read. Usually, you want memory mapped file if you want to see the files as a one memory array ( or ByteBuffer in Java ).

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

Sidebar

Related Questions

Background: I have a Spring 2.5/Java/Tomcat application. There is the following bean, which is
In my java web application, I have a single background-worker thread, which requires a
I have a Java application that run as a background service, i.e. no GUI.
Background: I have written a java swing based client server application. The server is
I have a java program that is running in the background(Windows). I would like
Background I have a Spring batch program that reads a file (example file I
Background: I have a Java application that many programming clients interface with. Recently, a
I have a Java application with a custom defined Look and Feel in which
I have a Java application which should run on a server machine in the
I have implemented a standalone java application which uses the swing framework for GUI.As

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.