( GMT +7:00 )

Senin, 27 Desember 2010

LowMemoryKiller in Android

LowMemoryKiller in Android
Android uses lowmemorykiller driver to kill selected process and free the memory, when some kind of low memory thresholds is met. Two files are generated in /sys file system for system tuning.

1. /sys/module/lowmemorykiller/parameters/adj
This file includes the oomadj array. If the corresponding minfree data is met, one of the process which oomadj are larger than this number will be killed.
About oomadj, the factor is introduced by OOMkiller module in the kernel. It is a property of the process. The range is from -17 to +15, the higher the score, more likely the associated process is to be killed by oom-killer. Lowmemorykiller use this score as well.
http://www.chineselinuxuniversity.net/articles/19534.shtml

2. /sys/module/lowmemorykiller/parameters/minfree
This file includes the threshold numbers for minfree memory size. The unit is page.

Example in Android
The default setting is in system/core/rootdir/init.rc.
# Write value must be consistent with the above properties.
write /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15

write /proc/sys/vm/overcommit_memory 1
write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144

# Set init its forked children's oom_adj.
write /proc/1/oom_adj -16

This means if the free memory is smaller than 1536*4K=6MB, one of the processes which adj is larger than 0 will be killed. If the free memory is smaller than 2048*4K=8MB, the process adj larger than 1 will be killed. And so on.

On the other hand, Android put the processes into 6 classes.
# Define the oom_adj values for the classes of processes that can be
# killed by the kernel. These are used in ActivityManagerService.
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 1
setprop ro.SECONDARY_SERVER_ADJ 2
setprop ro.HIDDEN_APP_MIN_ADJ 7
setprop ro.CONTENT_PROVIDER_ADJ 14
setprop ro.EMPTY_APP_ADJ 15

Say, the FOREGROUND application has the highest priority, the least likely to be killed. The CONTENT_PROVIDER and EMPTY_APP will be killed at first. Confusion here is we know the activity is the one people can see from UI. It actually means the process has foreground activity will have the highest priority, and the process which hosts the activity visible to user has the second priority.

Actually it defines two more priorities as below, in frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
// This is a process running a core server, such as telephony. Definitely
// don't want to kill it, but doing so is not completely fatal.
static final int CORE_SERVER_ADJ = -12;

// The system process runs at the default adjustment.
static final int SYSTEM_ADJ = -16;

In the ActivityManagerService, it starts some core service in a process and assigns it to SYSTEM_ADJ score.
ActivityManagerService.java did some other works as well. For example, it tracks which activity is running in background and foreground, and so it has use-count reference for the process. The java file is 11508 lines, like a monster.

To customize for some short-of-memory devices, we could change the threshold value accordingly. For example:
write /sys/module/lowmemorykiller/parameters/minfree 1536, 4096, 4096, 5120,5632,6144
This makes the driver kill the processes as early as possible. So the new application could get more memory.

sumber
http://swcai.blogspot.com/2009/02/lowmemorykiller-in-android.html

GPS Tweak Nexian Journey

Bagi yang punya masalah sama gps journey, kaga mau lock kesatelit atau ngelocknya seabad. Tenang.. itu bukan kerusakan hardware, harus disetting lagi agpsnya, karena bawaan androidnya msh blm disetting.

Berikut ini adalah tweak untuk gps journey :
Spoiler for GPS TWEAK:

-buka root explorer.
-buka file /system/etc/gps.conf.
-kasih permission 644.
-ubah file tersebut seperti dibawah.

################################
NTP_SERVER=id.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin

# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0

# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
ACCURACY_THRES=500

################################
##### AGPS server settings #####
################################

# FOR SUPL SUPPORT, set the following
SUPL_HOST=supl.google.com
SUPL_PORT=7276

# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234

################################
# EXTRA SETTINGS
################################

# FIH debug setting
FIH_DBG=0
################################

-Save, lalu reboot.

Abis reboot, dijamin lock ke satelit hanya itungan detik(tergantung dari kecepatan data intermet jurney). Untuk kota besar seperti Jakarta sangat sulit sekali lock kesatelit, maka dibutuhkan agps.

GPS Ephemeris Auto Downloadnya dicentang, biar akurasi gps makin tinggi. Untuk mengetahui satelit mana aja yang udah kelock bisa cari aplikasinya dimarket gps test atau gps status,free.

Udah dites dengan tweak diatas lock kesatelit hanya 3-5 detik daerah grogol.

sumber: http://www.kaskus.us/showpost.php?p=330661056&postcount=14

Sabtu, 25 Desember 2010

Setting Intenet WAP / APN

Kartu SIMPATI / AS:

GPRS
Profile Name : TSEL GPRS
APN : Telkomsel
User name : wap
Password : wap123
Authentication : Normal
Gateway IP address : 10.1.89.130
Homepage : http://wap.telkomsel.com
Data Bearer : GPRS
Proxy port number : 9201 atau 8000

MMS
Profile name: tel-MMS
Data Bearer: GPRS
Access Point Name: mms
Username: wap
Prompt Password: No
Password: wap123
Authentication: Normal
Proxy address: 10.1.89.150
Homepage: http://mms.telkomsel.com/
Connection Security: Off

Kartu Mentari:

GPRS
Profile Name : INDOSATGPRS
Homepage URL : http://wap.indosat.com
IP Address : 10.19.19.19
Bearer : GPRS
User Name : indosat
Password : indosat
APN : indosatgprs

MMS
Profile Name : INDOSATGPRS
Homepage URL : http://mmsc.indosat.com
IP Address : 10.19.19.19:8080
Bearer : GPRS
User Name : indosat
Password : indosat
APN : indosatmms

Kartu IM3:

GPRS
Profile name : M3-GPRS
Access point name : www.indosat-m3.net
User name : gprs
Password : im3
Authentication : Normal
Homepage : http://wap.indosat-m3.net
IP address : 010.019.019.019
Port : 9201 (standard), 8080 (proxy)

MMS
Profile name : M3-MMS
Access point name : indosatmms
User name : indosatmms
Password : indosatmms
Authentication : Normal
Homepage : http://mmsc.indosat-m3.net
IP address : 010.019.019.019
Port : 9201 (standard), 8080 (proxy)

Kartu XL:

GPRS
Profile name: XL-GPRS
Data Bearer: GPRS
Access Point Name: www.xlgprs.net
Username: xlgprs
Prompt Password: No
Password: proxl
Authentication: Normal
Homepage: http://wap.lifeinhand.com
Connection Security: Off
Session Mode: Permanent
IP Address: Automatic
Proxy Server Address: 202.152.240.050
Proxy Port Number: 8080

MMS
Profile name: XL-MMS
Data Bearer: GPRS
Access Point Name: www.xlmms.net
Username: xlgprs
Prompt Password: No
Password: proxl
Authentication: Normal
Homepage: http://mmc.xl.net.id/servlets/mms
Connection Security: Off
Session Mode: Permanent
IP Address: Automatic
Proxy Server Address: 202.152.240.050
Proxy Port Number: 8080

Kartu AXIS:

GPRS
Profile name : AXIS
Data Bearer : GPRS atau PS
Access Point Name (APN) : AXIS
Username : AXIS
Prompt Password : No
Password : 123456
Authentication : Normal
Gateway/Proxy IP Address : 10.8.3.8
Gateway/Proxy Port : 9201 atau 8080
Homepage : http://wap.axisworld.co.id
Connection Security : Off
Session Mode : Permanent

MMS
Profile name : AXISmms
Data Bearer : GPRS atau PS
Access Point Name (APN) : AXISmms
Username : AXIS
Prompt Password : No
Password : 123456
Authentication : Normal
Gateway/Proxy IP Address : 10.8.3.8
Gateway/Proxy Port : 9201 atau 8080
Homepage / MMS Server : http://mmsc.AXIS
Connection Security : Off
Session Mode : Permanent

Kartu THREE (TRI):

GPRS
Profile name: 3-GPRS
Homepage : http://wap.three.co.id/
Proxies : Enable
Proxy address : 10.4.0.10
Port : 3128
GPRS access point : 3gprs
Authentication type : Normal
Login type : Automatic
Username : 3gprs
Password : 3gprs

MMS
Profile name : 3-MMS
Homepage : http://mms.three.co.id/
GPRS access point : 3mms
Authentication type : Normal
Username : 3mms
Password : 3mms
Allow adverts : No

Kartu Telkomsel Flash:

GPRS
Profile Name : TSEL-Flash
APN : flash
User name : (kosongkan)
Password : (kosongkan)
Authentication : Normal
Gateway IP address : 10.1.89.130
Homepage : http://www.telkomsel.com/flash
Data Bearer : GPRS
Proxy port number : 9201 atau 8000

Indosat Broadband:

GPRS
Profile Name : INDOSAT-BROADBAND
Homepage URL : http://wap3g.indosat.com
IP Address : 10.19.19.19
Bearer : GPRS
User Name : indosat
Password : indosat
APN : indosatgprs