The MKMapView memory is released.

Source: Internet
Author: User

The MKMapView memory is released.

Memory release of MKMapView

By Wu xueying

- (void)dealloc {    self.mapView.showsUserLocation = NO;    self.mapView.userTrackingMode  = MKUserTrackingModeNone;    [self.mapView.layer removeAllAnimations];    [self.mapView removeAnnotations:self.mapView.annotations];    [self.mapView removeOverlays:self.mapView.overlays];    [self.mapView removeFromSuperview];    self.mapView.delegate = nil;    self.mapView = nil;}

Although not all the memory can be released, some of the memory can be released.



Memory release problems! !

Memory settings:
Now the Memory price is getting cheaper and cheaper. Many new users are using 1 GB of memory, and many others are upgrading the memory of old computers. After upgrading the physical memory, how can we effectively set the virtual memory to maximize performance improvement? Are some methods available on the Internet to optimize the virtual memory really effective? These are the content to be discussed in this article.

There are a lot of widely-spread tips on Virtual Memory Optimization on the Internet. In fact, many of them are hard to think about. Let's take a look.

Viewpoint 1: users with large physical memory can completely disable virtual memory. To thoroughly understand this problem, you must first understand what is virtual memory and what is the role of virtual memory. In the early days, because the memory price was very expensive, it was generally not configured too much on the computer, so sometimes if the number of memory required by the operating system and application programs exceeds the number of physical memory installed on the computer, the operating system will temporarily write data that does not need to be accessed to a special file on the hard disk through a paging operation, so as to release the memory for programs and data that need to use the memory immediately. This special file on the hard disk is a paging file (that is, a virtual memory file or a swap file ). For Windows 2000/XP/2003 operating systems, the paging file name is pagefile. sys, which is located in the root directory of the operating system partition by default.

Now that we know the origins and functions of the virtual memory, people who hold this theory believe that the speed of the hard disk and memory is quite different. If the virtual memory is disabled, the system does not need to take the time to paging the data in the memory to the hard disk, thus improving the operating efficiency of the system. However, according to the traditional design, many core functions of Windows Require paging files. If you disable all paging files, some third-party applications may encounter memory insufficiency errors. In fact, Windows does not use paging files when it is not needed. Therefore, you cannot improve performance by adjusting the system.

Opinion 2: for virtual memory, we recommend that you set it to 1.5-2 times the number of physical memory (the minimum and maximum values of virtual memory respectively ). Before discussing this issue, let's take a look at two cases: There are two computers with the same configurations except the memory. Computer A has MB of memory, and computer B has 1 GB of memory. Both Computers run Windows XP. In this way, the virtual memory of computer A will be set to 192 MB-256 MB, and the virtual memory of computer B will be set to 1.5 GB-2 GB. In practice, computer A may encounter insufficient virtual memory when running large software or games, computer B will waste hard disk space because of the large paging file. We will introduce how to set the virtual memory according to the actual situation.

Opinion 3: We can use the memory release software to release the memory occupied by running programs to improve the system running efficiency. Before denying this idea, we must first understand one thing. If any program is executed, it will occupy a certain amount of memory space (the specific amount of memory is determined by the size of the program itself and the size of the loaded data files). How does this so-called memory release software take effect? The software has not exited. Where can I release the memory? The original "optimization" software will all the memory occupied by the program will be paged into the virtual memory, resulting in the "illusion" of physical memory being released ".

If you have installed such software, open the Windows Task Manager, open the process tab, and select the "Select column" command under the "View" menu, select the "virtual memory size" option in the dialog box that appears later.

Remember the memory usage and virtual memory usage of several processes that occupy a large amount of memory, and then release them using the memory release software. This article will use the Windows Server 2003 Resource kittool empty.exe released by Microsoft. This tool has been very popular online some time ago, many people claim to have the function of releasing idle memory (although there are other tools for releasing memory, they do the same in principle ). Run "empty *. *". You can see that in a short period of time, a large amount of physical resources have been occupied... the remaining full text>

Memory release Problems

When the program ends normally, the system will clean up the garbage, so some people will use this cleaning function instead of releasing dynamic memory as one thing. This is obviously wrong and should be avoided, it is better to clean it up on your own. This is a good habit and must be adhered.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.