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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:22:38+00:00 2026-06-06T01:22:38+00:00

I have a Java 3D program which uses lots (hundreds) of 3D models (3ds

  • 0

I have a Java 3D program which uses lots (hundreds) of 3D models (3ds and obj).
The more models I use (and I really, really have to, it’s kind of 3D model of the real world object) the more heavier the program becomes, till the point when any single operation takes ages to complete.

CPU consumption rarely reaches 50%, mostly is moving between 10%-30%, but memory consumption is growing (obviously) with each added 3D model.

I know how to minimize memory imprint of c++/ c programs, but with Java’s GC is there anything I can do about it except increasing the JVM’s memory with -Xmx? I am already running with -xMx512Mb.

I have checked GC logs, using GCViewer, didn’t find anything suspicious.

I am aware of some very similar questions on SO, but none answered my question exactly.

My IDE is IntelliJ 11.

  • 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-06T01:22:40+00:00Added an answer on June 6, 2026 at 1:22 am

    There are two simple ways to decrease the number of objects you are creating, and one or both of them may work for your purposes, though without specifications I can’t be sure.

    1) Work with highly mutable objects. If you need to simulate a large number of things with a great deal of similarity, but which don’t have to interact with each other (for example, a hundred thousand simulations of a dozen particles interacting, with slightly different particles each time), then using the same dozen or so objects over and over, and making use of mutator functions to transfer the burden to the CPU. However, I doubt that using many objects in sequence is a problem for you, given that Java already has built-in garbage collection.

    2) Make the similarities between similar objects their own class. For example, if you have the need for a lot of objects, and you notice that a significant proportion of them share a number of memory-intensive characteristics, store those characteristics in their own class and refer to a single instance of that class in every object with the exact same field values. As an example, consider a set of Apple objects. You could either create different classes for GrannySmithApples, MackintoshApples, RedDeliciousApples with their own static fields for characteristics shared across the class (e.g. RedDeliciousApples have a static String field declared in the abstract class Apple and set to “red”), or (to allow more flexibility at runtime) each class could have an instance of CoreCharacteristic. If multiple objects share the same core characteristics, the code:

    CoreCharacteristic c = new CoreCharacteristic(<some parameters>);
    Apple apple1 = new Apple(c);
    Apple apple2 = new Apple(c);
    Apple apple3 = new Apple(c);
    Apple apple4 = new Apple(c);
    

    will use only one CoreCharacteristic for all four apples, quartering the amount of memory needed to store the fields of CoreCharacteristic which would have otherwise been replicated for each Apple.

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

Sidebar

Related Questions

I have avery simple program which uses MediaPLayer. I am new to java and
I have a simple program (written in Java) which uses the google protocol buffer
I have a Java program which uses a lot of text files. The program
I have a java program which uses arraylists - these arraylists store 'variables' where
I have a program which uses the Robot class in Java to automate a
I have a web app in Java, which uses some external program (invokes a
I have a Java program which is using WMIC to get certain information about
I have a java program which sends a udp packet to a server when
I have a Java program which prepares data into a fairly complex and big
I have a Java program in which an action is initiated which loops through

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.