Showing posts with label memory. Show all posts
Showing posts with label memory. Show all posts
Wednesday, March 1, 2017
Sunday, February 5, 2017
Memory Usage with cat proc meminfo
Memory Usage with cat proc meminfo
The entries in the /proc/meminfo can help explain whats going on with your memory usage, if you know how to read it.
Example of cat /proc/meminfo:
When you use memory, the CPU sets a bit in the pagetable and the VM checks that bit occasionally, and based on that, it can move pages back to active. And within active theres an order of "longest ago not used" (roughly, its a little more complex in reality).
Example of cat /proc/meminfo:
total: used: free: shared: buffers: cached:The information comes in the form of both high-level and low-level statistics. At the top you see a quick summary of the most common values people would like to look at.
Mem: 1050001408 1012899840 37101568 0 113672192 420950016
Swap: 2097434624 217985024 1879449600
MemTotal: 1025392 kB
MemFree: 36232 kB
MemShared: 0 kB
Buffers: 111008 kB
Cached: 279304 kB
SwapCached: 131780 kB
Active: 677908 kB
ActiveAnon: 487272 kB
ActiveCache: 190636 kB
Inact_dirty: 129164 kB
Inact_laundry: 23948 kB
Inact_clean: 15332 kB
Inact_target: 169268 kB
HighTotal: 131008 kB
HighFree: 2336 kB
LowTotal: 894384 kB
LowFree: 33896 kB
SwapTotal: 2048276 kB
SwapFree: 1835400 kB
Committed_AS: 1079884 kB
total: used: free: shared: buffers: cached:Below are the individual values. First we will discuss the high-level statistics.
Mem: 1050001408 1012899840 37101568 0 113672192 420950016
Swap: 2097434624 217985024 1879449600
MemTotal: 1025392 kB
MemFree: 36232 kB
MemShared: 0 kB
Buffers: 111008 kB
Cached: 279304 kB
SwapCached: 131780 kB
High-Level Statistics
- MemTotal: Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code)
- MemFree: Is sum of LowFree+HighFree (overall stat)
- MemShared: 0 is here for compat reasons but always zero.
- Buffers: Memory in buffer cache. mostly useless as metric nowadays
- Cached: Memory in the pagecache (diskcache) minus SwapCache
- SwapCache: Memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesnt need to be swapped out AGAIN because it is already in the swapfile. This saves I/O)
Detailed Level Statistics
VM Statistics
VM splits the cache pages into "active" and "inactive" memory. The idea is that if you need memory and some cache needs to be sacrificed for that, you take it from inactive since thats expected to be not used. The vm checks what is used on a regular basis and moves stuff around.When you use memory, the CPU sets a bit in the pagetable and the VM checks that bit occasionally, and based on that, it can move pages back to active. And within active theres an order of "longest ago not used" (roughly, its a little more complex in reality).
Active: 677908 kB
ActiveAnon: 487272 kB
ActiveCache: 190636 kB
Inact_dirty: 129164 kB
Inact_laundry: 23948 kB
Inact_clean: 15332 kB
Inact_target: 169268 kB
- Active: Memory that has been used more recently and usually not reclaimed unless absolutely necessary.
- Inact_dirty: Dirty means "might need writing to disk or swap." Takes more work to free. Examples might be files that have not been written to yet. They arent written to memory too soon in order to keep the I/O down. For instance, if youre writing logs, it might be better to wait until you have a complete log ready before sending it to disk.
- Inact_clean: Assumed to be easily freeable. The kernel will try to keep some clean stuff around always to have a bit of breathing room.
- Inact_target: Just a goal metric the kernel uses for making sure there are enough inactive pages around. When exceeded, the kernel will not do work to move pages from active to inactive. A page can also get inactive in a few other ways, e.g. if you do a long sequential I/O, the kernel assumes youre not going to use that memory and makes it inactive preventively. So you can get more inactive pages than the target because the kernel marks some cache as "more likely to be never used" and lets it cheat in the "last used" order.
Memory Statistics
HighTotal: 131008 kB
HighFree: 2336 kB
LowTotal: 894384 kB
LowFree: 33896 kB
SwapTotal: 2048276 kB
SwapFree: 1835400 kB
Committed_AS: 1079884 kB
- HighTotal: is the total amount of memory in the high region. Highmem is all memory above (approx) 860MB of physical RAM. Kernel uses indirect tricks to access the high memory region. Data cache can go in this memory region.
- LowTotal: The total amount of non-highmem memory.
- LowFree: The amount of free memory of the low memory region. This is the memory the kernel can address directly. All kernel datastructures need to go into low memory.
- SwapTotal: Total amount of physical swap memory.
- SwapFree: Total amount of swap memory free.
- Committed_AS: An estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM (out of memory) for this workload. Normally the kernel will overcommit memory. The Committed_AS is a guesstimate of how much RAM/swap you would need worst-case.
Available link for download
Tuesday, January 31, 2017
Memory Match Game
Memory Match Game

Who doesnt love a fun memory match game. I remember playing them all the time when I was little. I havent bought any memory games for Jake yet so I thought Id make him one after I was inspired by the one I saw on Dandee. This game was super easy to make and its great for starting a conversation about colors and shapes.
Heres what you need to make your own memory game:
-12 small 1.5" wooden discs. I bought mine at Michaels.
-Colored felt (if you dont want to spend the time cutting shapes out of felt you could also use foam stickers).
-Scissors
-Glue (I used a hot glue gun)
-Bag (optional, but a great way to take this game on-the-go)

As you can see Im not wonderful at cutting out felt shapes, but the good thing is Jake doesnt care. If you add Heat N Bond to the back of the felt its much easier to cut, but I was too lazy to do that step, hence the crooked cutting.

As you can see I almost always try to add a bag for all of our games when I can. We go out to eat a lot on the weekends and I just rotate the games in my bag each week. These games keep Jake happy and they allow me and my husband to have a more peaceful hands-free eating experience!
Hope you love this game as much as my lil man and I do.
Available link for download
Sunday, January 29, 2017
Memory Boxes
Memory Boxes
Im sentimental.
I love pictures and keepsakes.
Unfortunately Im horrible about scrapbooking or even getting pictures into albums. period.
I write in the kids memory books once every 6 months...maybe.
And now that they are getting older the baby books are kind of over with anyways.
The other day I found these photo boxes at Michaels so I decided to pick one up for each kid.
They are the perfect spot to put all of the kids special things I want to save for them, notes I have written to them (which I am trying to do a few times a year), handprints they have made at preschool, and pictures. Lots and lots of pictures.
And speaking of pictures...
It seems like Snapfish and Shutterfly are always emailing me coupons for free pictures. I finally started to use them and have been printing pictures for each of the kids to put in their boxes. That way they will have some of their special memories to take with them when they are older.
Im so excited to have found a system that actually works for me!
How do you guys perserve memories for your kids?
Id love to hear!
Available link for download
Subscribe to:
Posts (Atom)