[Sony Xperia Miro, Tipo (Dual), J, E] kurotsugi:
kernel.sysrq = 1
kernel.random.read_wakeup_threshold=256
kernel.random.write_wakeup_threshold=512
kernel.sched_latency_ns=20000000
kernel.sched_min_granularity_ns = 10000000
kernel.sched_wakeup_granularity_ns = 15000000
# kernel.sched_shares_ratelimit=256000
# kernel.sched_sched_compat_yield=1
kernel.shmmax=268435456
kernel.shmmni=4096
kernel.shmall=2097152
kernel.msgmni=4096
kernel.msgmax=65536
kernel.randomize_va_space=1
kernel.pid_max = 65536

fs.inotify.max_queued_events=32000
fs.inotify.max_user_instances=256
fs.inotify.max_user_watches=10240

vm.swappiness=10
vm.dirty_expire_centisecs=1000
vm.dirty_ratio=75
vm.dirty_background_ratio=75
vm.min_free_kbytes=5120
vm.dirty_writeback_centisecs=3000
vm.vfs_cache_pressure=50

net.ipv4.ip_local_port_range = 2000 65000
net.ipv4.ip_forward=0

net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.lo.accept_redirects = 1
net.ipv4.conf.lo.accept_source_route = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 1
net.ipv4.conf.all.accept_source_route=1
net.ipv4.conf.all.secure_redirects=1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route=1
net.ipv4.conf.default.accept_redirects=1
net.ipv4.conf.default.secure_redirects=1
net.ipv4.conf.all.log_martians = 0
net.ipv4.conf.lo.log_martians = 0

net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_probes=5
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_synack_retries=3
net.ipv4.tcp_syn_retries=3
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_congestion_control=cubic
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_dsack=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_fin_timeout=20
net.ipv4.tcp_moderate_rcvbuf=1
net.ipv4.tcp_mem=524288 524288 524288
net.ipv4.tcp_wmem=10240 87380 16777216
net.ipv4.tcp_rmem=10240 87380 16777216
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.icmp_echo_ignore_all=1
net.ipv4.udp_rmem_min=6144
net.ipv4.udp_wmem_min=6144
net.ipv4.ip_dynaddr=0
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.core.rmem_default=16777216
net.core.wmem_default=16777216
net.core.optmem_max=20480
net.core.netdev_max_backlog=5000
net.core.somaxconn = 65000
net.unix.max_dgram_qlen=50

save it as /etc/sysctl.conf and run 'sysctl -p' on terminal to activate it. this tweak should give you at least 60MB free ram on MIUI. you can also play with 'sys.mem.max_hidden_apps=10' value. higher value for multitasking and less value for UI responsiveness. I usually set it higher so that lowmemorykiller will do his job better. aside from it you can play with minfree value and turn off swap. zram might a good one but zramswap and swap is a bad thing

10 swappiness to make your device faster. it's no more than another android myth. the myth comes from linux environtment. on linux we usually have swap to get sleep/hibernate ability. but it comes with a cost of performance. using swap means a slower system. we usually set 10 as the swappiness to make the system almost never use the partition as ram cache.

on other hand, android as default didn't use swap so that any value of swappiness doesn't have any effect for the system. if you activate swap and use 10 as swappiness value, you actually do two completely contradictary thing. why should you activate swap if you make the system almost never use it? if you really want to use swap you should set it to 90.

another myth on android is high ram usage means slow system. that's what you got from windows. on linux higher ram usage means faster and more responsive system. on linux we even further develop such utilites like 'preload' or 'readahead' to maximize the ram usage.