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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:52:02+00:00 2026-06-14T22:52:02+00:00

I have a program that passes in huge amounts of data, say 1000 variables,

  • 0

I have a program that passes in huge amounts of data, say 1000 variables, through recursion. The recursion would run to atleast 50 or 60 times. What I’m worried about is, is there a possibility of data getting over- written on the memory locations because there isn’t much space, or if the case were that there is no memory, I would get some exception that the program memory has run out (I received no such error)?

Is there a possibility of getting a wrong solution because the program does not have any more memory and is over-writing on existing locations?

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

    There are two storage areas involved: the stack and the heap. The stack is where the current state of a method call is kept (ie local variables and references), and the heap is where objects are stored. The Hotspot documentation says that on Linux 64-bit each thread has a stack of 1024kB by default. The heap can be made arbitrary big, and today it’s in the order of GB.

    A recursive method uses both the stack and the heap. Which one you run out of first depends on the implementation. As an example, consider a method which needs thousands of integers: if they are declared as local variables, ie:

    public void stackOverflow() {
      int a_1;
      int a_2;
      int a_3;
      // ...
      int a_10_000_000;
    }
    

    your program will crask with a StackOverflowError. On the other hand, if you organize your integers in an array, like:

    public void outOfMemory() {
      int[] integers = new int[10 * 1000 * 1000];
    } 
    

    the heap will be filled soon, and the program will end with an OutOfMemoryError. In neither case the memory is corrupted or data overridden. However, in both cases the code is wrong and must be fixed somehow – but to tell you how we’d need to know more about your program.

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

Sidebar

Related Questions

Let say I have written a small program that reads file_A and file_B as
I have a program that passes command-line arguments to an associated file (i.e. associated
I have an android program that launches an intent and passes a value to
I have an old Fortran77 program that calls a C++ function and passes several
Hello i'm a new coder to android. I have a program that Plays Pauses
Well, i have written a simple python program that parses HTML with HTMLParser. Here
We have a program with a main() that parses certain CLPs but does not
I have program that requires Python 3, but I develop Django and it uses
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of

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.