Home » Microsoft » 70-517 » What should you do?
A server in the SharePoint farm experiences high memory usage. Task Scheduler on the server runs a Windows PowerShell script to perform backups of Wholesale sites. You need to resolve any memory leak issues in the Windows PowerShell script. What should you do? (Each correct answer presents a complete solution. Choose all that apply.)
A. Insert the code segment at line EW04:
Start-SPAssignment -Global
B. Insert the code segment at line EW17:
$site.Close()
C. Insert the code segment at line EW17:
Stop-SPAssignment -SemiGlobal
D. Insert the code segment at line EW17:
Stop-SPAssignment Global
Correct Answer: AC
Explanation/Reference:
* Start-SPAssignment Global initiates a new assignment store.
* Stop-SPAssignment . Disposes of objects in the provided assignment collection. The Stop-SPAssignment cmdlet disposes of objects in the provided assignment collection. Use the Global parameter to dispose of all objects in the global assignment collector and to stop the global store from collecting additional objects. Provide a SemiGlobal assignment collector to dispose of all contained objects.
From scenario:
* Performance Optimization and Memory Usage
SPSite objects must be removed from memory immediately after the objects go out of scope.