OutOfMemoryError ga selalu fatal. Ada kasus dimana dia worthed untuk
di-catch.
Kalau di application server, juga perlu melihat kondisinya.
Application server seperti WebLogic bisa mendeteksi dan melakukan graceful
shutdown atau self tuning jika mendapatkan exception seperti ini. Kalau
bagian menghandle error tersebut sudah dirancang untuk tidak menambah
alokasi heap, seharusnya gpp.

Contohnya lain, misalnya, di Eclipse IDE, waktu mau buka file text SQL yang
sangat besar, bisa terjadi nge-throw OutOfMemoryError. Component OSGi yang
melakukan loading file tersebut crash, tetapi container OSGi ga tewas, cuma
muncul popup window ngasi tau, lalu click OK. Eclipse IDE terus berjalan
dengan baik tanpa side effect, karena kondisi yang menyebabkan hal tersebut
bisa diatasi.


2009/12/4 Adelwin, Adelwin <adelwin.adel...@sc.com>

>
>
>  Ini dulu pernah gue debat sama temen nih…
>
> Lupa hasil nya gimana yah… :D
>
> Kalo missal nya kita catch Throwable… which is infact permitted by java…
>
> Lalu terjadi OutOfMemoryError… lalu yang catch tuh siapa sebenernya?
>
> Karna sebenernya udah collapse khan JVM nya?
>
> Coba ajah di debug…
>
> Kasi break point di catch clause di program bawah ituh..
>
> Gak akan di break..
>
> Semua udah collapse…
>
> Satu2 nya cara adalah di wrap…
>
> Either sama script, yang bisa monitor return dari java program…
>
> If return != 0 then error happened…
>
> Ato java program yang laen…
>
>
>
>
>
> *Adelwin Handoyo  |  Senior Consultant - Wholesale Bank*
> *Standard Chartered Bank*
> Plaza By The Park #06-00, 51 Bras Basah Road. Singapore (189554)
> *T* : (65) 655 72441  |* **E* adelwin.adel...@sc.com
>
>
>
>
>   ------------------------------
>
> *From:* jug-indonesia@yahoogroups.com [mailto:
> jug-indone...@yahoogroups.com] *On Behalf Of *Ifnu bima
> *Sent:* Friday, December 04, 2009 9:29 AM
> *To:* jug-indonesia@yahoogroups.com
> *Subject:* Re: [JUG-Indonesia] Jika Out Memory Program Keluar
>
>
>
>
>
> > Bagaimana caranya menangkap pesan Out Of Memory, saya pikir out of memory
> adalah bukan error karena tidak terkena di proses Exception.
> > saya ingin bila program terjadi out of memory ingin tampilkan pesan
> program harus akan keluar.
> > terima  kasih.
>
> bisa dicatch tapi aplikasi tetep harus direstart, karena kalau udah
> kena OutOfMemoryError JVMnya udah crash ga bs diperbaiki dan harus
> direstart.
>
> try{
>
> //kode
>
> } catch(java.lang.OutOfMemoryError ex) {
> //munculkan JOptionpane
> System.exit(0); // menutup aplikasi
>
> }
>
> --
>
> http://ifnu.artivisi.com
> +62 856 9211 8687
> regards
>
> This email and any attachments are confidential and may also be privileged.  
> If you are not the addressee, do not disclose, copy, circulate or in any 
> other way use or rely on the information contained in this email or any 
> attachments.  If received in error, notify the sender immediately and delete 
> this email and any attachments from your system.  Emails cannot be guaranteed 
> to be secure or error free as the message and any attachments could be 
> intercepted, corrupted, lost, delayed, incomplete or amended.  Standard 
> Chartered PLC and its subsidiaries do not accept liability for damage caused 
> by this email or any attachments and may monitor email traffic.
>
>
>
> Standard Chartered PLC is incorporated in England with limited liability 
> under company number 966425 and has its registered office at 1 Aldermanbury 
> Square, London, EC2V 7SB.
>
>
>
> Standard Chartered Bank ("SCB") is incorporated in England with limited 
> liability by Royal Charter 1853, under reference ZC18.  The Principal Office 
> of SCB is situated in England at 1 Aldermanbury Square, London EC2V 7SB. In 
> the United Kingdom, SCB is authorised and regulated by the Financial Services 
> Authority under FSA register number 114276.
>
>
>
> If you are receiving this email from SCB outside the UK, please click 
> http://www.standardchartered.com/global/email_disclaimer.html to refer to the 
> information on other jurisdictions.
>
>
>  
>



-- 
-o--o---( ^  ^ )---o--o-
Speed Optimization: Seek and ye shall find!
In case it isn't in the cache yet, too bad, you've to wait 40x longer.
Daniel Baktiar (http://dbaktiar.wordpress.com)

Kirim email ke