---
title: "Three occasions when you might use your own autorelease pools"  
description: "Three occasions when you might use your own autorelease pools"  
author: "Anonymous User"  
published: 2015-09-07  
updated: 2020-09-19  
canonical: https://www.mindstick.com/interview/22808/three-occasions-when-you-might-use-your-own-autorelease-pools  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Three occasions when you might use your own autorelease pools

If you are writing a program that is not based on a UI framework, such as a command-line tool.

If you write a loop that creates many temporary objects.You may create an autorelease pool inside the loop to dispose of those objects

before the next iteration. Using an autorelease pool in the loop helps to reduce the maximum memory footprint of the application.

If you spawn a secondary thread.

## Answers

### Answer by Anonymous User

If you are writing a program that is not based on a UI framework, such as a command-line tool.

If you write a loop that creates many temporary objects.You may create an autorelease pool inside the loop to dispose of those objects

before the next iteration. Using an autorelease pool in the loop helps to reduce the maximum memory footprint of the application.

If you spawn a secondary thread.


---

Original Source: https://www.mindstick.com/interview/22808/three-occasions-when-you-might-use-your-own-autorelease-pools

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
