@@ -154,10 +154,9 @@ def verifyOcVirtualMemory():
154154 # In OC tierup a memory slice is 8GB.
155155 # One extra slice is added for each allocation.
156156 # For actions, the main thread uses 529 slices; each read-only thread uses 11 slices.
157- # For sync calls, total 2 slices per call depth for a total of max_sync_call_depth on
158- # each thread
159- # Total virtual memory allocated by OC is around:
160- # 529 slices * 8GB (for main thread) + numReadOnlyThreads * 11 slices * 8GB
157+ # For sync calls, depth 1 reserves 5 slices, depth 2 reserves 4 slices, ...
158+ # depths 5 to 16 each 1 slices. Total is 26 slices for a max_sync_call_depth
159+ # of 16 for each thread.
161160 #
162161 # In addition, main thread and each read-only thread pre-allocates
163162 # `max_sync_call_depth` wasm allocator. Each wasm allocator mmap 8GB
@@ -173,10 +172,10 @@ def verifyOcVirtualMemory():
173172 memoryPerSlice = 8 * GB
174173 actionMainThreadSlices = 529
175174 actionRoThreadsSlices = args .read_only_threads * 11
176- syncCallSlices = 2 * totalThreads * maxSyncCallDepth
175+ syncCallSlices = 26 * totalThreads
177176 memoryByOC = (actionMainThreadSlices + actionRoThreadsSlices + syncCallSlices ) * memoryPerSlice
178177
179- memoryForOthers = 1000 * GB # add 1TB for virtual memory used by others
178+ memoryForOthers = 2500 * GB # add virtual memory used by others
180179 expectedVmSize = memoryByOC + memoryByWasmAllocators + memoryForOthers
181180 Utils .Print (f"pid: { apiNode .pid } , totalThreads: { totalThreads } , memoryByWasmAllocators: { memoryByWasmAllocators } , memoryByOC: { memoryByOC } , memoryForOthers: { memoryForOthers } , actualVmSize: { actualVmSize } , expectedVmSize: { expectedVmSize } " )
182181 assert (actualVmSize < expectedVmSize )
0 commit comments