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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:54:06+00:00 2026-05-24T15:54:06+00:00

I want to show users a heatmap with 10000 * 400 tiles. Current state

  • 0

I want to show users a heatmap with 10000 * 400 tiles. Current state in my program is that I have a class which is a JComponent. In this JComponent, I have instances of Image for the tiles. If I had a 300 * 300 matrix, the program uses between 800 and 1000 MB ram. This is too much.

What can I do else or has someone a control which can show such a big heatmap?

Today I have tested JHeatChart, which creates a BufferedImage. There the size for a 10000 * 400 matrix is under 400 MB, but the class needs over 15 Minutes to create it. This is too long.

Has anybody some idee or knows an control which can handle the data?

  • 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-24T15:54:07+00:00Added an answer on May 24, 2026 at 3:54 pm

    Since this will be a map, you do not need to create a component for each tile. many of them can be re-used. What you want to do is during initialization of the app, create a map of all possible components, and then on each tile pass a reference to that component.

    Here would be an example.

    public class HeatMap{
    
    private static List<JComponent> tiles = new ArrayList<JComponent>();    
    private List<JComponent> heatmap = new ArrayList<JComponent>();
    private Random rand = new Random();
    
    static{
        tiles.add(new JLabel("Cold"));
        tiles.add(new JLabel("Hot"));
        tiles.add(new JLabel("Warm"));
    }
    
    public HeatMap(){
        for(int i=0; i<10000; i++){
            for(int j=0; j<400; j++){
                    heatmap.add(tiles.get(rand.nextInt(3)));            
            }
        }
    }
    }
    

    In the above case we only have to create 3 tiles, the rest are references to those. This type of approach should help reduce your memory usage.

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

Sidebar

Related Questions

I have an index page that I want to show all the users' profile
Hello guys I have a List that I want to show for all users
So I have two users a mentor and a mentee. I want to show
I'm using speech recognition and I want to show the users that when they
I have a page with 3 users controls and I want to show one
I have a list of colors, with textures that I want to show to
I want to show my users the xml that gets generated for a certain
I have a page where I want onclick to show users kind of popup
I'm want to show all the users that are online, in real-time on my
I have 2 tables, voter and user. I want to show all users with

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.