Feature alarm

* fixed the resource capture function
* fixed so that alarm state changed according to the instance state.
* fix find_alarm method.
* fix evaluate memory_usage.