# Memory usage on aobench looks a bit odd

**URL:** <https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12>\
**Category:** Uncategorized\
**Created:** [January 6, 2015, 11:48pm UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12 "2015-01-06T23:48:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rubybench.org/sam/32/5_2.png) [@sam](https://community.rubybench.org/u/sam)\
**Post date:** [January 6, 2015, 11:48pm UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/1 "2015-01-06T23:48:50Z")

</div>

Looking at: [http://rubybench.org/tgxworld/ruby/releases?result\_type=app\_aobench](http://rubybench.org/tgxworld/ruby/releases?result_type=app_aobench)

memory usage is at say 96kb on 2.2.0

When running locally I notice

```auto
sam@ubuntu ruby-bench % ps aux | grep aob
sam 1301 79.3 0.1 34448 7388 pts/18 Sl+ 10:46 0:41 ruby bm_app_aobench.rb

```

so usage is at 34kb

Something is fishy here, why is there such a discrepancy?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/rubybench/original/1X/4ae23b7eff9a1b039e126f05dd734ab09c8ab4b5.png) [@system](https://community.rubybench.org/u/system)\
**Post date:** [January 8, 2015, 7:24am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/2 "2015-01-08T07:24:46Z")

</div>

Are memory benchmarks supposed to be stable? I tried running multiple times and it seems like the memory usage varies quite a bit. For releases, we’re running it 5 times and taking the min.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rubybench.org/sam/32/5_2.png) [@sam](https://community.rubybench.org/u/sam)\
**Post date:** [January 8, 2015, 8:00am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/3 "2015-01-08T08:00:31Z")

</div>

Can you reproduce:

![](https://sea2.discourse-cdn.com/flex016/uploads/rubybench/9/e41d3a940ec0fdcf.png)

Locally ?

Memory should be pretty stable (unless GC triggered a heap growth that can happen), try inside docker, then outside docker (just try reproing numbers for 2.2.0)

need exact script you are running and can you confirm the meaning of the numbers.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/rubybench/original/1X/4ae23b7eff9a1b039e126f05dd734ab09c8ab4b5.png) [@system](https://community.rubybench.org/u/system)\
**Post date:** [February 2, 2015, 5:51am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/4 "2015-02-02T05:51:36Z")

</div>

@sam Sorry for taking so long to get to this.

[Gist](https://gist.github.com/tgxworld/d4f1469feeb000478c43) script.

> [@sam](#):
>
> can you confirm the meaning of the numbers

`ps -o rss= -p #{pid}`. According to `man ps`:  
`rss RSS resident set size, the non-swapped physical memory that a task has used (inkiloBytes). (alias rssize, rsz).`

Let me know if anything is wrong. Thanks 😄

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/rubybench/original/1X/4ae23b7eff9a1b039e126f05dd734ab09c8ab4b5.png) [@system](https://community.rubybench.org/u/system)\
**Post date:** [February 2, 2015, 7:50am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/5 "2015-02-02T07:50:12Z")

</div>

@sam I think I see what you mean.

```auto
guoxiang@guoxiang-GS60-2PC-Ghost ruby (trunk) $ ruby benchmark/bm_app_aobench.rb 
260

guoxiang@guoxiang-GS60-2PC-Ghost ruby (trunk) $ ps aux | grep aob
guoxiang 4969 100 0.0 35428 7400 pts/5 Rl+ 15:46 0:38 ruby benchmark/bm_app_aobench.rb
guoxiang 5137 0.0 0.0 15944 932 pts/1 S+ 15:46 0:00 grep --color=auto aob

```

I have a feeling [this script](https://gist.github.com/tgxworld/b83d4988bfb4545a997a) is inaccurate.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rubybench.org/sam/32/5_2.png) [@sam](https://community.rubybench.org/u/sam)\
**Post date:** [February 3, 2015, 10:01am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/6 "2015-02-03T10:01:42Z")

</div>

ahhh yeah, the mem\_end - mem\_start thing makes little sense, ruby starts out with a bunch of allocated empty space.

instead just looking at RSS at the end should be fine.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/rubybench/original/1X/4ae23b7eff9a1b039e126f05dd734ab09c8ab4b5.png) [@system](https://community.rubybench.org/u/system)\
**Post date:** [February 6, 2015, 11:00am UTC](https://community.rubybench.org/t/memory-usage-on-aobench-looks-a-bit-odd/12/7 "2015-02-06T11:00:31Z")

</div>

@sam Ah ic! I’ve updated the benchmarks to just take the memory at the end of the script
