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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:04:02+00:00 2026-06-07T22:04:02+00:00

I have more than 20M data in MongoDB and by using java driver I

  • 0

I have more than 20M data in MongoDB and by using java driver I try to get data and plot chart by using JFreeChart.

I have simple main class which reads data from MongoDb,creates dataset and plots chart.When I run the program in PC (3GB Ram,i5 processor) it performs very slowly.In 10 hours it only performs 200K data.Then I try to run the code in IBM server with 24 GB RAM but the performance is same.

This is the command that i run :

java -cp my-program.jar:external1.jar:external2:jar Graph

Shouldn’t it be fast on the server? How could I improve the performance?

  • 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-07T22:04:03+00:00Added an answer on June 7, 2026 at 10:04 pm

    I solved the problem.It is not related with the Java, the problem is caused by Jfreechart.

    I am sorting data on MongoDB and add data to the XYSeries in order to create dataset.
    XYSeries has autoSort field in the constructor and by default it is true. That means when you add new item to the dataset it checks whether or not the items in the series are sorted. By setting it false improves the performance.

    XYSeries series = new XYSeries("followersCount",false);
    

    Secondly, I setted the notify to false in the add method. If it is not setted as false, then it sends notification to all registered listeners which reduces performance.

    series.add(1,2000,false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have more than 3000 members on a site built using wordpress. I am
Is it possible to have more than one data type within an array list,
I have a wpf column series chart and I have more than 15 columns.
I have more than 10GB .csv files. I m trying to import the data
Is it good practice to have more than one try{} catch{} statement per method?
I have more than 50,000 rows of data in Excel that look like this:
Can threads have more than one argument without using a struct? So... kind of
If I have more than one table on a page, and I try coloring
I have more than 100 million unique strings (VARCHAR(100) UNIQUE in MySQL database). Now
I have more than 400 000 id's in NOT IN statement. Whether it will

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.