[Sprint Samsung Galaxy Note II] tpeef:
Since this post got kind of long, I'm going to put a summary in the first paragraph. Zram is in this kernel already, it seems to work fine, and you probably don't want it. (Now you can skip the rest. :) )

zram has been in this kernel for some time. The precompiled version in the OP does not have it turned on, but it's in the source. I am running it on my phone, and it works fine. (I am not sure why you would WANT it on this phone, but it works fine.)

/*----------------------------------*/

If you want to build a kernel with zram on:

1)Enable it as a module.

(menuconfig: Staging Drivers -> Compressed RAM block device support = M, Optimize zram behavior for android = *)

(config / vi: CONFIG_ZRAM=m, CONFIG_ZRAM_FOR_ANDROID=y)

Edit: You'll also need to enable swap. The prebuilt kernel in OP has this enabled.

menuconfig: General setup -> Support for paging of anonymous memory

config/vi: CONFIG_SWAP=y

2)Build the kernel and modules, package 'em up, put 'em on your phone

When packaging, make sure you include a good (new) lib/modules/kernelname tree so you can probe the module.

3)You are not using zram!

4)Read the directions at drivers/staging/zram.txt to get started.

/*----------------------------------*/

/*----------------------------------*/

To check and see if your kernel was built with zram:

cat /proc/config.gz|gunzip|grep CONFIG_ZRAM

/*----------------------------------*/

That said, I don't know what zram DOES for this particular phone. It has gigs of RAM. My phone didn't even have a swap partition until I added the zram swap, and I never missed it.

To explain this in a very simple format:

When an OS needs more memory than it has, it can send some of the currently-used memory pages from memory to a swap area, and use the freed memory for whatever it's trying to do right now. Traditionally, this swap area is on a slow hard drive. In the case of a phone, it's on a faster-than-disk but slower-than-RAM flash storage device such as the phone's internal storage or SD card.

Zram takes part of this badly-needed memory and compresses it with lzo, and makes that available to the OS as a swap area. (Actually, zram doesn't care what you do with it; you can also make it into a regular compressed ramdisk.)

Now when the OS (which has less memory available now, since part is used by Zram) needs memory, it can do its usual page swap, but it writes it to the compressed memory area instead of the slow disk or flash. (This also saves r/w cycles on the flash if you're actually paging.)

This is great on phones... you are trading the CPU cycles needed to compress/decompress the memory pages for the flash I/O. Much faster!

If your phone has, say, 100MB of RAM, and you give 25 MB over to Zram, it can have 75MB of fast RAM, and a slower storage area that can hold 23-75MB of information (if you put a bunch of uncompromisable data in there it will actually get slightly larger, but sparse pages can compress nicely). We're using lzo, so we're going to see great speed but sub-par compression.

For normal usage, you've taken 25 MB of your RAM and turned it into a slower (maybe) 50 MB of "RAM". The "size" of this swap area depends how compressible the stuff you put in it is.

For our hypothetical phone with 100 MB of RAM, this is a big win... we increased our "RAM" by 25% at the expense of a few CPU cycles.

..but this is the Galaxy Note II forum. This phone has crazy RAM. If you ever run out, look into Zram. I am not sure how you would run out of memory, though. :)

I've been using zram all day here:

root@android# cat /proc/swaps

Filename

sed Priority Type Size

/dev/block/zram0 partition 31740

1

root@android# cat /sys/block/zram0/num_writes

1

root@android# cat /sys/block/zram0/num_reads

2

root@android# cat /proc/meminfo

MemTotal: 1833964 kB

MemFree: 246048 kB

Buffers: 61284 kB

Cached: 508648 kB

SwapCached: 0 kB

...

root@android# free

total used free shared buffers

Mem: 1833964 1551840 282124 0 62232

-/+ buffers: 1489608 344356

Swap: 31740 0 31740

CONCLUSION: It works, but unless you actually manage to run this phone out of RAM, don't bother.