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

  • Home
  • SEARCH
  • 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 6536747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:31:51+00:00 2026-05-25T10:31:51+00:00

I have to store about 10k text lines in an Array. Each line is

  • 0

I have to store about 10k text lines in an Array. Each line is stored as a separate encrypted entry. When the app runs I only need to access a small number and decrypt them – depending on user input. I thought of some kind of lazy evaluation but don’t know how to do it in this case.

This is how I build up my array: [allElements addObject: @"wdhkasuqqbuqwz" ] The string is encrypted. Accessing is like txt = [[allElements objectAtIndex:n] decrypt]

The problem currently is that this uses lots of memory from the very start – most of the items I don’t need anyway, just don’t know which ones ;). Also I am hesitant to store the text externally eg in a textfile, since this would make it easier to access it.

Is there a way to minimize memory usage in such a case?

ps initialization is very fast, so no issue here

  • 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-25T10:31:52+00:00Added an answer on May 25, 2026 at 10:31 am

    So it’s quite a big array, although not really big enough to be triggering any huge memory warnings (unless my maths has gone horribly wrong, I reckon your array of 10,000 40-character strings is about 0.76 MB. Perhaps there are other things going on in your app causing these warnings – are you loading any large images or many assets?

    What I’m a little confused about it how you’re currently storing these elements before you initalise the array. Because you say you don’t want to store the text externally in a text file, but you must be holding them in some kind of file before initialising your array, unless of course your values are generated on the fly.

    If you’ve encrypted correctly, you shouldn’t need to care whether your values are stored in plain-sight or not. Hopefully you’re using an established standard and not rolling your own encryption, so really I think worrying about users getting hold of the file is a moot point. After all, the whole point of encryption is being able to hide data in plain sight.

    I would recommend, as a couple of your commenters already have, is that you should just use some form of database storage. Core Data was made for this purpose – handling large amounts of data with minimal memory impact. But again, I’m not sure how that array alone could trigger a memory warning, so I suspect there’s other stuff going on in your app that’s eating up your memory.

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

Sidebar

Related Questions

I have made a app which uses visual studio's app.config to store settings about
I have a stored proc that processes a large amount of data (about 5m
I have to store blog style comments in a database. Each comment can have
I need to store about 100 thousands of objects representing users. Those users have
For instance if I have http://www.mywebsite.com/about.aspx . Store about.aspx (or whatever page we're on)
I´m thinking about to write an application will have to store a small amount
I've got a database which will store profiles about individuals. These individuals have about
I have about 500 images as resources in my app. First, is that a
I have an array to store a set of coordinates for painting a piece
I have issue where I need store info about users in DB and authorize

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.