zoukankan      html  css  js  c++  java
  • ios 清理缓存

    一段清理缓存的代码如下:

    模式一(网上摘取):

    dispatch_async(

    dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)

    , ^{

                        NSString *cachPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask, YES) objectAtIndex:0];

                        

                        NSArray *files = [[NSFileManager defaultManager] subpathsAtPath:cachPath];

                        NSLog(@"files :%d",[files count]);

                        for (NSString *p in files) {

                            NSError *error;

                            NSString *path = [cachPath stringByAppendingPathComponent:p];

                            if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {

                                [[NSFileManager defaultManager] removeItemAtPath:path error:&error];

                            }

                        }

                        [self performSelectorOnMainThread:@selector(clearCacheSuccess) withObject:nilwaitUntilDone:YES];});

    -(void)clearCacheSuccess

    {

        NSLog(@"清理成功");

    }

    二.(自己写的)

  • 相关阅读:
    Tsar 服务器系统和应用信息的采集报告工具
    mysqltuner
    MySQL性能监控工具-MONyog
    tuning-primer.sh mysql 报表
    mytop
    InnoTop
    mysql监控管理工具--innotop
    iotop,pt-ioprofile : mysql IO负载高的来源定位
    PERCONA-TOOLKIT 工具的安装与使用2
    PERCONA-TOOLKIT : pt-ioprofile分析IO情况
  • 原文地址:https://www.cnblogs.com/seth-chen/p/4362494.html
Copyright © 2011-2022 走看看