1

给定一个 NuSMV 模型,如何找到它的运行时以及它消耗了多少内存?

因此可以在系统提示符下使用此命令找到运行时:/usr/bin/time -f "time %es" NuSMV filename.smv

以上给出了挂钟时间。有没有更好的方法从 NuSMV 本身获取运行时统计信息?

另外如何找出程序在处理文件期间使用了多少 RAM 内存?

4

1 回答 1

0

一种可能性是使用该usage命令,该命令显示当前正在使用的RAM量,以及工具自启动以来使用的用户系统usage时间(因此,应在每次操作之前和之后调用你想要配置文件)。

示例执行:

NuSMV > usage
Runtime Statistics
------------------
Machine name: *****
User time    0.005 seconds
System time  0.005 seconds

Average resident text size       =     0K
Average resident data+stack size =     0K
Maximum resident size            =  6932K

Virtual text size                =  8139K
Virtual data size                = 34089K
    data size initialized        =  3424K
    data size uninitialized      =   178K
    data size sbrk               = 30487K
Virtual memory limit             = -2147483648K (-2147483648K)

Major page faults = 0
Minor page faults = 2607
Swaps = 0
Input blocks = 0
Output blocks = 0
Context switch (voluntary) = 9
Context switch (involuntary) = 0

NuSMV > reset; read_model -i nusmvLab.2018.06.07.smv ; go ; check_property ; usage
-- specification (L6 != pc U cc = len) IN mm is true
-- specification  F (min = 2 & max = 9) IN mm is true
-- specification  G !((((max > arr[0] & max > arr[1]) & max > arr[2]) & max > arr[3]) & max > arr[4]) IN mm is true
-- invariant max >= min IN mm is true

Runtime Statistics
------------------
Machine name: *****
User time   47.214 seconds
System time  0.284 seconds

Average resident text size       =     0K
Average resident data+stack size =     0K
Maximum resident size            = 270714K

Virtual text size                =  8139K
Virtual data size                = 435321K
    data size initialized        =  3424K
    data size uninitialized      =   178K
    data size sbrk               = 431719K
Virtual memory limit             = -2147483648K (-2147483648K)

Major page faults = 1
Minor page faults = 189666
Swaps = 0
Input blocks = 48
Output blocks = 0
Context switch (voluntary) = 12
Context switch (involuntary) = 145
于 2018-12-05T08:25:52.053 回答