調整磚集區大小Tile pool resizing

如果應用程式需要更多串流資源對應至工作集,重新調整磚集區的大小以增加磚集區,如果需要較少空間則縮小。Resize a tile pool to grow a tile pool if the application needs more working set for the streaming resources mapping into it, or to shrink if less space is needed. 針對應用程式使用的另一個方法,是為串流資源配置額外磚集區。Another option for applications is to allocate additional tile pools for new streaming resources. 但如果任何單一串流資源需要的空間,比其磚集區一開始提供的更多,則增加磚集區的大小會是不錯的選擇。But if any single streaming resource needs more space than initially available in its tile pool, growing the tile pool is a good option. 串流資源無法同時對應至多個磚集區。A streaming resource can't have mappings into multiple tile pools at the same time.

當磚集區大小增加時,顯示驅動程式會透過一個或多個新配置,以在尾端新增額外的磚。When a tile pool is grown, additional tiles are added to the end via one or more new allocations by the display driver. 應用程式看不到這項分解至配置的過程。This breakdown into allocations isn't visible to the application. 現有磚集區中的記憶體將不會變更,且對應至記憶體的現有串流資源維持不變。Existing memory in the tile pool is left untouched, and existing streaming resource mappings into that memory remain intact.

當磚集區縮小時,會從尾端移除磚。When a tile pool is shrunk, tiles are removed from the end. 磚的數量甚至能低於初始配置大小,最小至 0,這表示新的對應無法超過新的大小。Tiles are removed even below the initial allocation size, down to 0, which means new mappings can't be made past the new size. 不過,超過新大小的現有對應會維持不變,而且依然可以使用。But, existing mappings past the end of the new size remain intact and useable. 只要驅動程式為磚集區記憶體所使用的任何配置對應保持不變,顯示驅動程式就會保留記憶體。The display driver will keep the memory around as long as mappings to any part of the allocations that the driver uses for the tile pool memory remains. 如果在進行縮小後,有一些記憶體因為磚的對應指向它們而保留,然後磚集區大小因應狀況而再次增加的話 (任何數量都算),則現有的記憶體會被重新使用,之後才會為增加作業提供額外的配置。If after shrinking some memory has been kept alive because tile mappings are pointing to it and then the tile pool is regrown again (by any amount), the existing memory is reused first before any additional allocations occur to service the size of the grow operation.

若要節省記憶體,應用程式不僅需要縮小磚集區,也需針對最新的小型磚集區大小移除或重新對應現有對應。To be able to save memory, an application has to not only shrink a tile pool but also remove/remap existing mappings past the end of the new smaller tile pool size.

縮小的動作 (和移除對應) 並不一定會立即省下記憶體。The act of shrinking (and removing mappings) doesn't necessarily produce immediate memory savings. 釋出的記憶體會依顯示驅動程式磚集區基礎配置的細微程度而定。Freeing of memory depends on how granular the display driver's underlying allocations for the tile pool are. 當縮小記憶體的行動會使顯示驅動程式配置無法使用時,顯示驅動程式就無法釋放記憶體。When shrinking happens to be enough to make a display driver allocation unused, the display driver can free it. 如果磚集區已經增加的話,縮小至之前的大小 (並相對地移除/重新對應磚對應) 很可能會節省記憶體的空間,但在大小不完全符合顯示驅動程式所選的基礎配置大小時,則不一定。If a tile pool was grown, shrinking to previous sizes (and removing/remapping tile mappings correspondingly) is most likely to yield memory savings, though not guaranteed in the case that the sizes don't exactly align with the underlying allocation sizes chosen by the display driver.

相關主題Related topics

對應是到並排顯示集區Mappings are into a tile pool