Question  102 
 You are designing a Windows application that accesses information stored on a SharePoint 2010 intranet site. The application displays employee information in a data grid sourced from a list on the Human Resources site. To filter and manipulate the employee details list, the design includes a class to cache the data that is accessed. The class keeps the SPWeb object open, but only retrieves data that is not already cached. You need to ensure proper memory utilization and resource management for the application. Which approach should you recommend?
A. Implement the class with the IDisposable interface and allow the .NET Framework garbage collector to automatically manage the SPWeb object disposal.
B. Implement the class with the IDisposable interface and explicitly dispose of the SharePoint SPWeb object when you are finished using it.
C. Implement the class as a fully managed .Net Framework object and allow the .NET Framework garbage collector to automatically manage the SPWeb object disposal.
D. Implement the class as a fully managed .Net Framework object and explicitly manage the SPWeb object using the ISPerformanceMonitor interface.

解析:
   你开发了一个Windows应用程序去获取存储在Sharepoint 站点列表中的数据,此列表存储了公司员工信息,你的Windows应用程序将会在一个Data Grid控件中显示这些员工信息,为了便于对这些信息进行过滤和处理,你使用了一个类去缓存这些信息, 此类让SPWeb对象保持打开, 当Windows应用程序想查询某些数据,而这些数据在此缓存中找不到时才去访问Sharepoint站点列表资源,你需要确保内存的合理使用和应用程序对资源的合理管理。
   本题涉及Sharepoint对象的创建与内存回收,我们知道,一些 SharePoint Foundation 对象(主要是 SPSite 类和 SPWeb 类对象)被创建为托管对象。但是,这些对象使用非托管代码和内存来执行其大多数工作。对象的托管部件比非托管部件小得多。因为较小的托管部件不会给垃圾收集器施加内存压力,所以垃圾收集器不会及时从内存中释放对象。如果对象使用大量非托管内存,则可能导致前面描述的某些异常行为。在 SharePoint Foundation 中处理 IDisposable 对象的调用应用程序在使用完这些对象后必须释放它们。不应该依赖垃圾收集器从内存中自动释放对象。所以,只有选项B符合要求。
   选项A,依赖于垃圾收集器从内存中自动释放对象,所以不对。
   选项C.D,都是创建完全的托管对象,而SPWeb与SPSite涉及非托管代码,所以也应该被排除。
因此本题答案应该选  B

参考 
http://msdn.microsoft.com/en-au/library/ee557362(v=office.14).aspx
http://blogs.msdn.com/b/rogerla/archive/2009/01/14/try-finally-using-sharepoint-dispose.aspx

Question  103 
 You are asked to analyze a SharePoint 2010 system that is experiencing performance problems, especially under heavy loads. The system contains multiple custom Web applications and third-party Web Parts. The performance problems are exhibiting the following symptoms:
.The application pool recycles frequently.
.The system experiences slow client response times.
.The system experiences excessive page faults.
You need to identify a possible source of these performance issues and suggest a way to verify your analysis. What should you do?
A. Propose that the custom code in the third-party application is not disposing of its objects properly, and verify the theory by checking the Unified Logging Service (ULS) logs for entries related to the SPRequest object.
B. Propose that the paging file size is too large, and verify the theory by using the System Monitor to see if the % Usage counter for the paging file is 50% or less.
C. Propose that the application pool recycle setting should be changed to recycle less frequently and verify the theory by retesting the system to verify improved performance.
D. Propose that the application be moved to a server with a faster disk system that supports fault tolerance and retest the system to verify improved performance.

解析:
   某个Sharepoint系统出现了运行效率问题,尤其是加载大量数据时就会显得很慢。此Sharepoint包含了若干用户开发的Web应用程序和第三方的Web Part控件,并且在运行时有如下现象:
 现象1. 应用程序池频繁的被回收
现象2. 客户端运行反应很慢
现象3. 过多的页面报错
   针对上述情况,你需要分析并找出解决办法。
   从上述情况描述也符合Sharepiont内存泄露的情形,如果看了Question101,你会很容易定位到选项A为本题的正解。
   选项B.设置Page File Size,它是虚拟内存的组成,对它的调整可以影响基于.net架构程序的运行效率。但此参数与本题所描述的应用程序池的运行问题毫无关系。
   选项C.设置应用程序池回收频率不足以造成现象2与3的情况,所以排除。
   选项D.在较慢的硬盘上运行不足以造成过多的页面报错以及应用程序池频率被回收的情况,所以排除。
因此本题答案应该选  A

参考 
http://msdn.microsoft.com/zh-cn/library/ee557362(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ff647813.aspx
http://msdn.microsoft.com/zh-cn/library/aa720473(v=vs.71).aspx

Question  104 
 You are designing a SharePoint 2010 application. The code makes numerous calls to SPSite and SPWeb objects.The system and application performance is poor in the test environment. There is also a high level of memory use for IIS worker processes. You need to ensure that the application performance and high memory use issues are addressed. Which approach should you recommend?
A. Use the Resource Throttling settings in Central Administration to increase site resource thresholds.
B. Use the SPSite and SPWeb SharePoint 2010 Power Shell cmdlets.
C. Ensure that the Dispose method of SPSite and SPWeb is called throughout the code.
D. Ensure that the Close method of SPSite and SPWeb is called throughout the code.

解析:
   你设计一个Sharepoint应用程序,在开发代码中多次调用了SPSite和SPWeb对象。当在开发环境中测试程序时发现它的运行效率很慢,而且你发现IIS工作进程对内存的占用率很高。你需要找出造成这种现象的具体原因。
   如果看了Question101,这道题也很容易定位到选项C。
   你可能对选项D存有疑问,为什么不能Close呢?我们知道,Dispose与Close都可以用于释放内存,但Close方法只能用在你先自行创建了SPSite对象,然后再去释放它。如果你是引用(Reference)了一个SPSite对象,你就不能通过Close方法去释放它。
  所以我们通常推荐使用Dispose方法来代替Close方法,因为在Dispose方法中最终还是调用了Close方法,但它是通过IDisposable接口来实现的,所以.NET Framework的垃圾回收机制会调用 Dispose方法来释放与此对象相关的内存。
  至于选项A是用来限制返回过多结果集以防止对Sharepoint系统效率造成冲击(如规定,List只能返回2500条记录)。它与内存的泄露无关。所以排除。
  选项B则更与本题描述无关了,使用Power Shell命令行工具来使用SPSite与SPWeb对象与本应用程序对SPSite和SPWeb对象的使用并由此造成的内存泄露毫无关系,所以也被排除。
因此本题答案应该选 C

参考 
http://msdn.microsoft.com/en-au/library/ee557362(v=office.14).aspx
http://jerryyasir.wordpress.com/2009/11/22/resource-throttling-in-sharepoint-2010/

Sharepoint学习笔记—习题系列--70-576习题解析 -(Q102-Q104)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. 实战MEF(5):导出元数据

    如何理解元数 我们可以把元数据理解为随类型一起导出的附加信息.有时候我们会考虑,把元数据随类型一并导出,增加一些说明,使得我们在导入的时候,可以多一些筛选条件. 默认的类型导出带有元数据吗 上面的内容 ...

  2. 传智播客--XAML布局--连连看界面(小白内容)

    一个简单的10*10连连看,有100个格子,可以在XAML里面用ColumnDefinition和RowDefinition各写10组,但是这样效率会很慢,因此,可以采用动态生成的方式进行. publ ...

  3. 窥探Swift之需要注意的基本运算符和高级运算符

    之前更新了一段时间有关Swift语言的博客,连续更新了有6.7篇的样子.期间间更新了一些iOS开发中SQLite.CollectionViewController以及ReactiveCocoa的一些东 ...

  4. 如何部署Icinga客户端

    Icinga客户端的部署相对于服务器端来说,简单很多.对于服务器端来说,如果要通过以下这种方式来监控服务器,必须包含三个组件,Icinga内核,Icinga插件,NRPE(Nagios Remote ...

  5. 【记录】ASP.NET MVC View 移动版浏览的奇怪问题

    ASP.NET MVC View 中的一段代码: <span id="span_Id">@Model.ID</span> 没什么问题吧,浏览器浏览正常,查看 ...

  6. CentOS初始化Mysql5.7密码

    /etc/init.d/mysql stopmysqld_safe --user=mysql --skip-grant-tables --skip-networking &mysql -u r ...

  7. 【原】IOS合并lib(.a)库的终极可用方法(可用于解决duplicate symbol静态库冲突)

    网上流传了太多关于合并lib库的方法,自己也尝试过,但大多失败.有感于这种急于解决问题,经过百般尝试后依旧无果的无奈心情,小翁在这里用一个实例来完整阐述如何在mac中合并lib静态库. 这里以移动广告 ...

  8. objective-c 语法快速过(1)

    有一定 c++或者 java 基础,过一遍 oc 语法即可,都是相通的,个人认为难点是 oc 的内存管理,虽然有了 ARC,但是也需要学习下,因为有旧软件的维护. 建立在C语言的基础上,增加了一层小范 ...

  9. 【Java基础】并发

    Num1:同步访问共享的可变数据 关键字Synchronized可以保证在同一时刻,只有一个线程可以执行某一个方法,或者某一个代码块.. 同步不仅仅理解为互斥的方式,如果没有同步,一个线程的变化就不能 ...

  10. AppCan学习笔记--数据存储及listview简单应用

    AppCan AppCan开发平台简介 AppCan是Hybrid App开发框架即混合开发框架,有官方提供底层功能使用API HTML5和JavaScript只是作为一种解析语言,真正调用的都是Na ...