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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:03:12+00:00 2026-06-10T03:03:12+00:00

I work on a small company where I work to build some banking software.

  • 0

I work on a small company where I work to build some banking software. Now, I have to build some data structure like:

Array [Int-Max] [2] // Large 2D array

Save that to disk and load it next day for future work.

Now, as I only know Java (and little bit C), they always insist me to use C++ or C. As per their suggestion:

  1. They have seen Array [Int-Max] [2] in Java will take nearly 1.5 times more memory than C and C++ takes some what reasonable memory footprint than Java.

  2. C and C++ can handle arbitrarily large files where as Java can’t.

As per their suggestion, as database/data-structure become large Java just becomes infeasible. As we have to work on such large database/data-structure, C/C++ is always preferable.

Now my question is,

  1. Why is C or C++ always preferable on large database/data-structure over Java ? Because, C may be, but C++ is also an OOP. So, how it get advantage over Java ?

  2. Should I stay on Java or their suggestion (switch to C++) will be helpful in future on large database/data-structure environment ? Any suggestion ?

Sorry, I have very few knowledge of all those and just started to work on a project, so really confused. Because until now I have just build some school project, have no idea about relatively large project.

  • 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-10T03:03:14+00:00Added an answer on June 10, 2026 at 3:03 am

    why C/C++ is always preferable on large database/data-structure over
    Java ? Because, C may be, but C++ is also an OOP. So, how it get
    advantage over Java ?

    Remember that a java array (of objects)1 is actually an array of references. For simplicity let’s look at a 1D array:

    java:

    [ref1,ref2,ref3,...,refN]
    ref1 -> object1
    ref2 -> object2
    ...
    refN -> objectN
    

    c++:

    [object1,object2,...,objectN]
    

    The overhead of references is not needed in the array when using the C++ version, the array holds the objects themselves – and not only their references. If the objects are small – this overhead might indeed be significant.

    Also, as I already stated in comments – there is another issue when allocating small objects in C++ in arrays vs java. In C++, you allocate an array of objects – and they are contiguous in the memory, while in java – the objects themselves aren’t. In some cases, it might cause the C++ to have much better performance, because it is much more cache efficient then the java program. I once addressed this issue in this thread

    2) Should I stay on Java or their suggestion (switch to C++) will be
    helpful in future on large database/data-structure environment ? Any
    suggestion ?

    I don’t believe we can answer it for you. You should be aware of all pros and cons (memory efficiency, libraries you can use, development time, …) of each for your purpose and make a decision. Don’t be afraid to get advises from seniors developers in your company who have more information about the system then we are.

    If there was a simple easy and generic answer to this questions – we engineers were not needed, wouldn’t we?

    You can also profile your code with the expected array size and a stub algorithm before implementing the core and profile it to see what the real difference is expected to be. (Assuming the array is indeed the expected main space consumer)


    1: The overhead I am describing next is not relevant for arrays of primitives. In these cases (primitives) the arrays are arrays of values, and not of references, same as C++, with minor overhead for the array itself (length field, for example).

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

Sidebar

Related Questions

Imagine you work for a small lean software company. You know the future competitiveness
We have a small work group that I would like to encourage to adopt
I work for a small OEM manufacturer and have been tasked with making some
At my company, we have a very small (<5) team. We build internal web
The small company i work for have asked me to MAYBE write a webservice
Context: I work at a small software company that has traditionally done research-type work,
I work at a small company, and we connect to our development environment via
I work in a small company and we - as many others = use
I work for a small company with a .NET product that was acquired by
Work on this small test application to learn threading/locking. I have the following code,

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.