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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:43:24+00:00 2026-05-16T00:43:24+00:00

Plan to have a data structure to store temporary binary data in the memory

  • 0

Plan to have a data structure to store temporary binary data in the memory for analysis.

The max size of the data will be about 10MB.

data will be added at the end 408 bytes at a time.

no search, retrieve operations on those temporary binary data.

data will be wipe out and the storage will be reused for next analysis.

questions:

  1. which structure is good for this purpose? byte[10MB], List<bytes>(10MB), List<MyStruct>(24000), or ...?
  2. how to quickly wipe out the data (not List.Clear(), just set the value to 0) for List or array?
  3. If I say List.Clear(), the memory for this List will shrink or the capacity (memory) of the List is still there and no memory allocation when I call List.AddRange() after the Clear()?
  4. List.Insert() will make the List larger or it just replace the existing item?
  • 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-16T00:43:24+00:00Added an answer on May 16, 2026 at 12:43 am

    If your data is usually the same size, and always under a certain size, use a byte array.

    Create a byte[], and a int that lets you know where the end of the “full” part of that buffer stops and the “free” part starts. You never need to clear it; just overwrite what was there. The only problem with this is if your data is sometimes 100 kb, sometimes 10 MB, and sometimes a bit larger than you originally planned for.

    List will be slower to use and larger in memory, although they handle various sizes of data out of the box.

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

Sidebar

Related Questions

I have a structure called Patch that represents a 2D array of data. newtype
So i have this structure html <span class=label data=data/support_icon.png> <span class=title>1 User/Location - 8Am
I plan to design a data structure including elements as this, {1, 13, 15,
I've written a service and I plan to have multiple applications communicate with it
I'm going to be doing some webscraping and my plan is to have something
I have a JMeter test plan with following http request samplers. Login Call some
We have a daily maintenance plan in SQL Server 2005 that performs a full
I have been trying to implement an upgrade plan for my Android app which
I have the following query: select p from Plan as p where p.location =
I have a UIScrollview with a UIImageview inside it showing a floor plan. I

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.