Thanks for the memory!

This is the story of me trying to make goose.creighton.edu:8080/openmrs run faster.

My first idea was to allocate any of the extra memory on the server to my web app. I found a settings file called “setenv.sh” and opened it up to find:

export JAVA_OPTS="-server -XX:+UseParallelGC -Xmx1024m -XX:PermSize=
256m -XX:MaxPermSize=512m -Djava.awt.headless=true"root@goose:/usr/
share/tomcat6/bin#

The 1024m basically means that OpenMRS on goose was allowed to have 1GB, or a small flash drive’s worth of memory. Dr. Wierman suggested changing the 256 to 512 and the 512 to 1024, or to keep increasing those values until I broke it. Confused, I wanted to find out how much memory goose even had. So, I did:

root@goose:~# cat /proc/meminfo
MemTotal:        1015836 kB
MemFree:           75104 kB
Buffers:           18084 kB
Cached:            54532 kB
SwapCached:       144048 kB
Active:           396248 kB
Inactive:         494176 kB
Active(anon):     373024 kB
Inactive(anon):   460656 kB
Active(file):      23224 kB
Inactive(file):    33520 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:        129416 kB
HighFree:           1712 kB
LowTotal:         886420 kB
LowFree:           73392 kB
SwapTotal:       1036284 kB
SwapFree:         377404 kB
Dirty:                32 kB
Writeback:             0 kB
AnonPages:        674820 kB
Mapped:            11600 kB
Shmem:             15864 kB
Slab:              33732 kB
SReclaimable:      21136 kB
SUnreclaim:        12596 kB
KernelStack:        3000 kB
PageTables:         4104 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1544200 kB
Committed_AS:    1973740 kB
VmallocTotal:     122880 kB
VmallocUsed:       10848 kB
VmallocChunk:     108876 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       4096 kB
DirectMap4k:       36856 kB
DirectMap4M:      872448 kB

Simple enough, right? This is how I learned that out of slightly less than 1GB of “MemTotal” about 0.07 GB was “MemFree.” My OpenMRS was already allowed to have more memory than the server had to offer.

Dr. Wierman said he had a bag of memory laying around somewhere, and he would look for some that would work with goose. That sounded funny to me so I asked, “What does memory look like?” My question must have sounded funny to him too because he repeated it smiling and pulled out that previously mentioned bag of memory. Nothing in the bag matched the “MT-M 8810-WCX” sticker on goose, so Dr. Wierman opened up penguin.creighton.edu and handed me the 1GB memory from that server… “Here, you can put this in goose.” I took it excitedly down the hall. “Don’t forget to unplug it first!”

Leave a comment