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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:39:33+00:00 2026-06-06T04:39:33+00:00

Imagine you are simulating particle physics. You, then, have a position vector for each

  • 0

Imagine you are simulating particle physics. You, then, have a position vector for each of your objects that is changed at a rate of several times per second. If your vectors are not destroyed but just copied, won’t this cause your program to flood your memory until it ends?

  • 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-06T04:39:35+00:00Added an answer on June 6, 2026 at 4:39 am

    Imagine you are simulating particle physics.

    I’ll try.

    You, then, have a position vector for each of your objects

    I’ll just assume those are just a handful of abstracted fundamental particles per sim, not terabytes of experimental data.

    that is changed at a rate of several times per second. If your vectors are not destroyed but just copied, won’t this cause your program to use too flood your memory until it ends?

    This is a pretty fundamental question apart from all the context above. The answer is “it depends”.

    Is your language garbage collected? What language in particular (no pun intended) is it?

    Do you need historical data? Or more generally, what is the reason for not destroying the vectors in the first place? Are all of them still actively used, referenced?

    If you need all of them for the sim, i.e. the answer to the above question would be: Yes, but there isn’t much you can do about it. Maybe a) using size-optimized, possibly custom, data and list types and b) if practically applicable – depends on the volatility of the data – applying a pattern that allows you to store only differences (unchanged vectors could be stored as references to the previous version etc.)

    If you don’t need them for the running sim, but need to keep them “for later”, just flush them out to disc in large enough chunks as to not waste IO cycles, after that step the same applies as…:

    If you don’t need them at all, make sure to allow the garbage collector to work effectively (again, details depend on language used) or free them or re-use the allocated memory etc…

    This is a pretty general question and the context you are giving, while it makes you interesting, doesn’t really give us much to go on.

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

Sidebar

Related Questions

Imagine that I have a engine gem A that has your application.css and application.js
Imagine you have a website with several drop-downs that are populated from the back-end
Imagine you have an application with several hundreds of classes implementing dozens of high
Imagine I have a service that looks like this: public interface MyAccountService { boolean
imagine that I have 3 variables in a array: $var1 = a; $var2 =
imagine i have NSData object and i have 2 options to fill that up.
Imagine we have a set of entities each of which has its state: free,
Imagine that I have a store. I have an admin side to the store
Imagine that you have a class with a member variable private var radius:Number; And
Imagine you have one use case register contract and one extension attach document. The

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.