RSS feed [root] /weblog




login:

password:

title search:




 


Tue Jan 17 22:34:04 HKT 2017

weblog


log down some useful resource


(google search) (amazon search)
second
download zip of files only

Thu Nov 16 15:20:44 HKT 2017 From /weblog/hardware

gpu


Inside Fermi: Nvidia's HPC Push - http://www.realworldtech.com[..]m/page.cfm?ArticleID=RWT093009110932&p=1

GPUs don’t support interrupts and exception, and less branches - http://www.futurechips.org/chip-design-for-all/cpu-vs-gpgpu.html

Example of running stuff at GPU - http://fastml.com/running-things-on-a-gpu/

http://www.infoq.com[..]icles/which-gpu-to-get-for-deep-learning

http://www.benfrederickson.com[..]mplicit-matrix-factorization-on-the-gpu/

(google search) (amazon search)


Thu Nov 16 09:55:26 HKT 2017 From /weblog/design

static


I will prefer using static method as less as possible... there is some
side effect you are not expected, like, are you sure it thread safe? static
method easier to have thread problem.

You may take a look at http://debasishg.blogspot.com[..]007/03/making-classes-unit-testable.html , http://www.beust.com/weblog/archives/000173.html and http://discuss.joelonsoftware.com[..]Parent=7972&ixDiscussGroup=3&cReplies=29

Parameter passing vs static accessor: Should I press things around or get from public static instance? - http://groups.yahoo.com/group/refactoring/message/3342

Reason of static method is not overrided - http://groups.google.com[..]thread/ec8b924d60dd4734/99b488aa1f8106c9

Another example of thread problem with static member - http://jroller.com[..]=calendar_dateformat_and_multi_threading

How to mock static method code for testing - http://blog.xebia.com/2007/06/21/mocking-static-calls/

http://googletesting.blogspot.com[..]ic-methods-are-death-to-testability.html

Factory is bad? - http://www.yegor256.com/2017/11/14/static-factory-methods.html

(google search) (amazon search)


Wed Nov 15 11:00:37 HKT 2017 From /weblog/computer+science

CG


smallpt is a global illumination renderer. It is 99 lines of C++, is open source, and renders the above scene using unbiased Monte Carlo path tracing - http://www.kevinbeason.com/smallpt/

Code review Doom - http://fabiensanglard.net/doomIphone/doomClassicRenderer.php

Story of Game development on NES - http://games.greggman.com/game/programming_m_c__kids/

Fast Approximate Anti-Aliasing (FXAA) - http://www.codinghorror.com[..]fast-approximate-anti-aliasing-fxaa.html

Free book - http://www.gabrielgambetta.com[..]-graphics-from-scratch/introduction.html

(google search) (amazon search)



Tue Nov 14 19:26:33 HKT 2017 From /weblog/unix

vim


Web base vim as tutorials - http://www.knowvim.com/ http://www.openvim.com/tutorial.html

History of VIM - http://arstechnica.com[..]f-productivity-vims-20th-anniversary.ars

Guide for editing text object, most already familiar with using 'w' for word editing, this blog discuss more about using 'p' for paragrahy and other related stuff. - http://blog.carbonfive.com[..]7/vim-text-objects-the-definitive-guide/

Seven habits of effective text editing , a lot of nice tip of using vim, like hlsearch , omni-completion

http://www.moolenaar.net/habits.pdf
http://video.google.com/videoplay?docid=2538831956647446078

vimdiff tips - http://blog.objectmentor.com[..]cles/2008/04/30/vim-as-a-diff-merge-tool http://gcody.blog.ccidnet.com[..]9899-uid-36931-do-showone-type-blog.html

How to regex with line number - http://vim.wikia.com/wiki/Insert_line_numbers_2

cheat sheet of jumping around source code - http://www.faqs.org[..]inux-HOWTO/C-editing-with-VIM-HOWTO.html

Nice analysis of good programming environment - http://www.benrady.com[..]why-i-switched-from-textmate-to-vim.html

Creating macros in vim - http://smartic.us/2010/02/03/creating-macros-in-vim

http://www.markhneedham.com/blog/2010/12/27/vim-learnings-so-far/ <- introduction to Command-T and FuzzyFinder

Some VIM tips:

Essential Vim editor navigation commands
Vim search and replace – 12 powerful find and replace examples.
How To add bookmarks inside the Vim editor
How To record and play inside the Vim editor
Correct spelling mistakes automatically inside the Vim Editor
Automatic word completion using Ctrl-X
Enable thesaurus option in the Vim editor
Vim autocommand magic. Add custom header to your files automatically.
Convert Vim editor to a beautiful source code browser.
Use the Vim editor as a bash IDE, or C/C++ IDE, or Perl IDE.

http://www.thegeekstuff.com/2010/04/vim-editor-tutorial/ https://spin.atomicobject.com[..]com/2016/04/19/vim-commands-cheat-sheet/

ctrl+w, ctrl+w , vimdiff switch folder - hack2live.blogspot.com/2009/02/vimdiff-shortcut-keys.html

tutorial - http://javarevisited.blogspot.com[..]editor-in-unix-example-tutorial-and.html https://danielmiessler.com/study/vim/ https://www.reddit.com[..]s/3mfvdg/how_do_i_go_about_learning_vim/

Compilation plugin - http://www.vim.org/scripts/script.php?script_id=3115#2.9.3

Highlight multiple searches at the same time, each with a different color. - http://www.vim.org/scripts/script.php?script_id=479 http://www.vim.org/scripts/script.php?script_id=2666#2.6.0

C/C++ IDE - http://www.vim.org/scripts/script.php?script_id=213 http://blog.wuwon.id.au[..]10/vim-plugin-for-navigating-c-with.html

Evil, putting vi in emacs - http://spin.atomicobject.com/2013/02/28/emacs-or-vim-evil/

Fixing syntax at solaris, "export TERM=xtermc", ":syntax enable" - http://kdl.nobugware.com/post/2006/12/01/23-xterm-color-on-unix

Graph your Vim undo tree in style. - http://sjl.bitbucket.org/gundo.vim/

Introduction to Selecta and Command-T, tool for fuzzy mapping and open files easier - http://marcovaltas.com/2013/12/27/selecta-on-vim-wildignore.html

http://superuser.com[..]d-the-vimrc-file-be-located-on-windows-7

Open Visual Studio config as XML - https://groups.google.com/forum/#!topic/vim_use/HzVM9tjJP08

Snippert library ( e.g. function template ) - https://www.reddit.com[..]3h7lca/which_snippet_library_do_you_use/

https://www.reddit.com[..]t_are_your_musthave_configs_and_plugins/

https://www.reddit.com[..]mments/2w22gf/edit_google_docs_with_vim/

https://www.reddit.com[..]nts/3ijsi2/original_post_a_vimrc_primer/

https://www.reddit.com[..]an_autocomplete_plugin_if_yes_which_one/

gUU to turn whole line upper case, and guu to turn whole line lower case - https://www.reddit.com[..]_guu_makes_an_entire_line_lowercase_and/

can use :TOhtml to turn a text file to HTML - http://jezenthomas.com/how-i-write-invoices-in-vim/

set encoding=utf-8 - https://www.reddit.com[..]how_to_reliably_switch_to_using_utf8_by/

If you like to test the regex for vi, can refer to this - http://www.virex.org/

http://www.hostingadvice.com[..]/blog/vim-creator-champions-charityware/

Another blog about using vim as IDE - https://spacevim.org/2017/02/11/use-vim-as-a-java-ide

http://vimsheet.com

(google search) (amazon search)


Mon Nov 13 00:44:30 HKT 2017 From /weblog/design

API design guideline


This is a message from a management blog, but I think the arguement is also apply API design. In fact, I think most critical difference of good and bad API is knowing which small detail is important and which is not - http://www.goodproductmanager.com[..]er.com/2007/11/08/sweat-the-small-stuff/

Design tips:
http://www.artima.com/weblogs/viewpost.jsp?thread=142428
http://openide.netbeans.org/tutorial/api-design.html
http://www.cincomsmalltalk.com[..]gView?showComments=true&entry=3258158706
http://today.java.net[..]its-of-highly-profitable-developers.html
http://www.infoq.com/news/2007/08/why-api-design-matters
http://www.infoq.com/presentations/effective-api-design
http://neuroning.com/2006/11/19/on-api-design-guidelines

About Compatibility issues
http://wiki.eclipse.org/Evolving_Java-based_APIs

A blog of using interfaces-vs-abstract-classes
http://hoskinator.blogspot.com[..]6/04/interfaces-vs-abstract-classes.html

XOM design overview - http://www.xom.nu/designprinciples.xhtml#d0e309

You need to identify the business value but not pick any tools/design just because it is cool - http://myarch.com/what-is-good-soa

A lot of links here - http://kasparov.skife.org/blog-live/src/api-design-refs.writeback http://discuss.joelonsoftware.com/default.asp?design.4.527465

An introduction of good OSS project to study their source - http://techkriti.wordpress.com[..]com/2007/06/28/learning-from-the-source/

CCCCDPIPE - http://blog.objectmentor.com/articles/2007/08/02/which-came-first

Discussion of why getting feedback quick is important - http://blog.objectmentor.com[..]u-dont-know-until-you-take-the-next-step

Someone saying that routines is the greatest invention in CS, I agree - http://www.codinghorror.com/blog/archives/001129.html

New way of modeling system then layering, The Onion Architecture - http://jeffreypalermo.com/blog/the-onion-architecture-part-1/

SOLID - http://www.lostechies.com[..]of-the-month-march-solid-principles.aspx http://dotnet.dzone.com/news/solid-software-works <-- very good picture! http://www.blackwasp.co.uk/SOLIDPrinciples.aspx

Idempotent, Orthogonality, Immutability - http://www.codinghorror.com/blog/archives/001244.html

Some example of how to driven good API - http://jdegoes.squarespace.com[..]al/2009/5/11/good-api-design-part-3.html

It's not enough to write tests for an API you develop, you have to write unit tests for code that uses your API. When you do, you learn first-hand the hurdles that your users will have to overcome when they try to test their code independently. http://butunclebob.com[..]MichaelFeathers.TheGoldenRuleOfApiDesign

Active interface vs. Passive interface, for me this is another way to under "Tell, don't ask" - http://code-o-matic.blogspot.com[..]-on-api-design-call-stack-as-source.html

The Principles of Good Programming - http://www.artima.com/weblogs/viewpost.jsp?thread=331531

http://net.tutsplus.com[..]software-principles-you-must-understand/

Difference choice of how API evolute with change - http://blog.jooq.org[..]sive-api-evolution-with-java-interfaces/

JUnit's evolving structure. - http://edmundkirwan.com/general/junit.html

API performance contract - http://queue.acm.org/detail.cfm?ref=rss&id=2576968

Consistent naming conventions
Standard terminology
Uniform error responses
Attention to detail (that’s the love part for APIs)
REST APIs that work with only 2 resources and use 4 HTTP verbs (oh, there is so much more to talk about here…)
Avoid API design by way of method-driven approach – that leads you down a slippery slope
- See more at: http://blogs.ancestry.com[..]are-like-parenting/#sthash.Ux1LHMNU.dpuf

http://blog.jooq.org[..]ake-this-mistake-when-developing-an-spi/

Guideline for webapi - https://cloud.google.com/apis/design/

(google search) (amazon search)


Sat Nov 11 11:59:17 HKT 2017 From /weblog/business

facebook


The sale strategy of facebook - http://cn.wsj.com/big5/20120203/atc125226.asp?source=rss

https://medium.com[..]ding-the-facebook-algorithm-e106dc2f7d15

(google search) (amazon search)


Sat Nov 11 11:54:29 HKT 2017 From /weblog/health/food

egg


嚴說養生 立夏吃雞蛋 - http://www.yimho.com/1443.html

烹制雞蛋美食的四種方法 - http://cn.wsj.com/big5/20140513/DJL071521.asp?source=rss

More ways of cooking egg - http://www.buzzhand.com/post_282334.html

http://list25.com/25-awesome-egg-facts-you-might-not-know/

二十文錢劏房飯:仿西班牙蛋餅 - https://thestandnews.com[..]%BF%E7%8F%AD%E7%89%99%E8%9B%8B%E9%A4%85/

(google search) (amazon search)


Sat Nov 11 11:02:22 HKT 2017 From /weblog/health/food

mushrooms


https://www.zmescience.com[..]on-medicine/mushrooms-antioxidants-rich/

(google search) (amazon search)


Sat Nov 11 10:51:34 HKT 2017 From /weblog/health/food

alcohol


美國人出書向世界介紹中國白酒 - http://cn.wsj.com/big5/20140311/bog144857.asp?source=rss

https://www.zmescience.com[..]e/drinking-alcohol-cancer-risk-10112017/

(google search) (amazon search)


Fri Nov 10 00:06:22 HKT 2017 From /weblog/learning

communication


https://medium.com[..]ers-i-learned-from-bartending-6a5f36829b

(google search) (amazon search)


Wed Nov 08 00:48:02 HKT 2017 From /weblog/design/examples

netflix


https://medium.com[..]ens-every-time-you-hit-play-3a40c9be254b

(google search) (amazon search)


Tue Nov 07 16:01:37 HKT 2017 From /weblog/java/performance

cases


A case showing java is faster than C++ - https://groups.google.com[..]mgroups#!topic/comp.lang.c++/7aNw3PzPvMI

Case show how to improve GC time spend on a java application - http://javaeesupportpatterns.blogspot.com.au[..]11/java-vm-beware-of-younggen-space.html

A case study of solving thread contention - http://blogs.mulesoft.org[..]fighting-thread-contention-in-your-code/

http://www.cubrid.org[..]-of-java-application-performance-tuning/

Notes about measuring map performance - http://vanillajava.blogspot.com.au[..]ronicle-map-and-yahoo-cloud-service.html

High Performance Java - Binary instead of Objects - John Davies - https://vimeo.com/138956045 http://www.infoq.com/presentations/java-low-latency

jemalloc, look like a really nice tool - https://gdstechnology.blog.gov.uk[..]c-to-get-to-the-bottom-of-a-memory-leak/

story of finding why there is so many GC - http://www.infoq.com[..]horough-jvm-thorough-analysis-ygc-part01

GC thread blocked by system call - http://www.infoq.com/cn/articles/GC-Log-Uncovers-Pause https://www.infoq.com/articles/GC-Log-Uncovers-Pause

We always need benchmark - https://arnaudroger.github.io[..]2017/06/15/forward-vs-backward-loop.html

Investigation and solutions of performance issue caused by GC log - https://engineering.linkedin.com[..]c-pauses-caused-by-background-io-traffic

(google search) (amazon search)




Sun Nov 05 01:19:04 HKT 2017 From /weblog/science

nature


蓋亞假說:美麗的神話 - http://thehousenews.com[..]%8E%E9%BA%97%E7%9A%84%E7%A5%9E%E8%A9%B1/

色彩斑斕的動物 - http://cn.wsj.com/big5/20131203/PHO101146.asp?source=rss

地球上仍存活的最古老生物 - http://cn.wsj.com/big5/20140430/PHO082434.asp?source=rss

deep-sea-mysteries-and-oddities-that-will-leave-you-baffled - http://list25.com[..]nd-oddities-that-will-leave-you-baffled/

rare-flowers-that-are-stunning-to-look-at - http://list25.com/25-rare-flowers-that-are-stunning-to-look-at/

earth-facts-that-might-surprise-you - http://list25.com/25-earth-facts-that-might-surprise-you/

north-pole-facts-most-people-are-not-aware-of - http://list25.com[..]s-most-people-are-not-aware-of/?view=all

earth-facts-you-probably-have-not-considered - http://list25.com[..]u-probably-have-not-considered/?view=all

http://www.attenboroughsreef.com/

amazon - http://list25.com[..]he-most-unique-places-on-earth/?view=all

25 Interesting Tidbits About Deserts That Will Make You Glad For Rain - http://list25.com[..]at-will-make-you-glad-for-rain/?view=all

Antarctica is one of the coldest, most desolate places in the world, and today you're going to learn all about it. - http://www.damncoolpictures.com[..]interesting-facts-that-you-probably.html

great-barrier-reef - http://list25.com[..]-reef-facts-youll-want-to-hear/?view=all

Types of mountains - http://www.zmescience.com[..]st/main-types-mountains-earths-ups-downs

bizarre-ocean-phenomena - http://list25.com[..]ean-phenomena-you-wont-believe-are-real/

http://www.zmescience.com[..]ology/animals-ecology/animal-speed-limit

Ocean - http://list25.com[..]ising-ocean-facts-most-people-dont-know/

Earth - http://list25.com/25-shocking-facts-you-never-knew-about-earth/

sinkholes - https://www.zmescience.com[..]other/science-abc/science-abc-sinkholes/

(google search) (amazon search)


Sat Nov 04 18:09:49 HKT 2017 From /weblog/business

people


http://www.infoq.com/news/2012/11/mindset-focus-people

Pros and cons of opening the salary - http://cn.wsj.com/big5/20130219/eoe080851.asp

Not providing a psychologically safe environment is how organizations fire smart people. - https://blog.liberationist.org[..]no-one-would-ever-get-fired-827601fb8af1

https://thinkgrowth.org[..]utive-hires-at-your-startup-5531d8cb770d

(google search) (amazon search)


Fri Nov 03 09:41:42 HKT 2017 From /weblog/database/performance

numa


https://technet.microsoft.com[..]m/en-us/library/ms345403(v=sql.105).aspx

https://code.kx.com/q/cookbook/linux-production/

http://jcole.us[..]swap-insanity-and-the-numa-architecture/

(google search) (amazon search)


Fri Nov 03 00:32:07 HKT 2017 From /weblog/trip/travelling

Indonesia


遊記分享 - 詩巴丹神山十二日瘋狂之旅 (更新左最美的神山16/3) - http://go2nature.net[..]t=0&sid=af04440b821a247a2384f9f4e5ec15e1

http://martinfowler.com/bliki/Saba.htmlReally need to go this place once - http://thenatureoftheworlds.blogspot.hk[..]2/pangrango-national-park-indonesia.html

Really need to go this place once - http://thenatureoftheworlds.blogspot.hk[..]2/pangrango-national-park-indonesia.html

【印尼】峇里島十大必去景點和體驗 - http://blog.kkday.com/2016/11/Bali10mustdo.html

http://www.travelettes.net/hidden-paradise-in-indonesia/

(google search) (amazon search)


Thu Nov 02 23:27:00 HKT 2017 From /weblog/learning

habit


How habit affecting you - http://stephencfchan.blogspot.com[..]2012/02/poor-study-habit-and-remedy.html

How to change habit - http://cn.wsj.com/big5/20120420/trv075618.asp?source=rss

How to quit bad habit - http://now.eloqua.com[..]028&elq=2220804c77864d95acba08b4a6f21c23

好奇心,细节 - http://blog.sina.com.cn/s/blog_47841af70102e1yi.html

The most interesting things I've learnt about learning - http://jchyip.blogspot.com.au[..]-most-interesting-things-ive-learnt.html

The most interesting things I've learned about improvement - http://jchyip.blogspot.com.au[..]t-interesting-things-ive-learned_14.html

* Increase your exposure to new and different ideas
* Spend as much time learning from your trading as you actually spend trading
* Manage yourself, not just your risk and your positions

http://traderfeed.blogspot.hk[..]hree-best-practices-of-best-traders.html

http://traderfeed.blogspot.com[..]/energy-well-being-and-success-four.html

直覺的奧妙 — Blink - https://thestandnews.com[..]%A6%BA%E7%9A%84%E5%A5%A7%E5%A6%99-blink/

1)  How does the person spend his or her free time?  Per Ayn Rand's observation above, what does he or she do for enjoyment?  

2)  How does the person respond to your successes?  Many people are willing to commiserate with you when you're down and elevate themselves in the process.  A person of genuine goodwill celebrates your successes and is happy for your happiness.

3)  What strong beliefs does the person voice and live through their actions?  Character means standing for what you believe in and living your beliefs.  Go along and get along might be comfortable, but commitment is what powers effective action in the world.

http://traderfeed.blogspot.hk[..]hree-powerful-measures-of-character.html

Ask as a habit - https://thestandnews.com[..]%83%E9%80%99%E5%80%8B%E5%95%8F%E9%A1%8C/

practice consistently, stay warm - http://www.zmescience.com[..]brain/halo-starcraft-practice-excellence

Wake up early - https://medium.com[..]e-guide-for-waking-up-early-a750c011eb07

This will work, I believe, but really not easy - https://journal.thriveglobal.com[..]e-your-life-in-just-a-month-eed6c90ee6c4

(google search) (amazon search)


Thu Nov 02 23:19:18 HKT 2017 From /weblog/learning

reading


智能手機時代的速讀技術 - http://cn.wsj.com/big5/20140416/lif115306.asp?source=rss

Fun testing - http://projects.wsj.com/speedread/?mod=readin

Fun information, text layout related to speed of reading: http://www.codinghorror.com/blog/archives/000618.html

Martin fowler discuss about the skill of how to read/write a big big book http://martinfowler.com/bliki/DuplexBook.html , more discussion - http://blog.jayfields.com/2007/06/reading-technical-books.html

關掉手機 享受慢閱讀的樂趣 - http://cn.wsj.com/big5/20141004/lif105708.asp?source=rss

这里有一个原则同学们要记住:不重要的学术作品大可不读,但重要的要反复重读,读多遍。不要相信重要作品的简化阐释,因为作者究竟怎样想我们不可能从简化的阐释中学到。 - http://blog.sina.com.cn/s/blog_47841af70102ux5w.html

Rarely will I get through every section of every book.  The idea is to create a kind of dialogue among the authors, identifying points of overlap and difference.  Very often, the ideas from one book will trigger ideas that have you scouring the other books for elaboration.  The mixture of ideas from several books will lead to a thought that is not contained in any of the books.  When you read in parallel, it's like being in the room while the authors are conversing.  The intersecting of ideas almost always stimulates fresh ways of thinking about (and applying) the topic at hand. - http://traderfeed.blogspot.hk[..]ding-in-parallel-becoming-better-at.html

Read for communication - http://cn.wsj.com/big5/20170210/OPN170636.asp

https://qz.com[..]this-year-according-to-harvard-research/

在第一遍阅读时,你并不需要理解一个冗长计算的所有步骤。相反,默认它们是正确的,跳过它们,深入阅读关键的步骤。读公式之间的文字描述,读实验结果,读结论。当你大致明白了文章所谈论的东西之后,你再决定是否把时间花费在代数部分。不要在看不懂的步骤上花太多时间。当你以后有空时,可以重复阅读来慢慢理解它们。 - http://www.infoq.com[..]/2017/08/how-Read-machine-earning-papers https://www.reddit.com[..]achine_learning/?st=j6lm438g&sh=b1d9eba7

Reading to Learn: Why You Shouldn’t Read Beginning-to-End and What to do Instead - https://medium.com[..]-end-and-what-to-do-instead-4ab613e9a41d

I divided the day into four four-hour periods, of which I would be reading in three of the four-hour periods, and free one of them - https://betterhumans.coach.me[..]of-my-scholarship-and-study-68d1c35dd0d5

(google search) (amazon search)


Wed Nov 01 23:52:07 HKT 2017 From /weblog/trip/travelling

IrelandScotland


19 Stunning Things To See And Do Across Ireland - http://frame.bloglovin.com[..]=5824984083&blog=4289795&frame_type=none

The Ultimate Trip To Game Of Thrones Locations In Northern Ireland - http://www.dcfever.com/travel/deal.php?id=20140&link=guid http://www.fangirlquest.com/travel/game-of-thrones-locations/

Scotland castle - http://thenatureoftheworlds.blogspot.com[..]m/2013/12/dunnottar-castle-scotland.html

https://handluggageonly.co.uk[..]autiful-road-scotland-youve-never-heard/

amazing-things-unique-about-scotland - http://list25.com[..]g-things-unique-about-scotland/?view=all


(google search) (amazon search)



Wed Nov 01 23:36:13 HKT 2017 From /weblog/trip/travelling

Canada


http://www.southerncurlsandpearls.com[..]7/08/banff-lake-louise-travel-guide.html

https://youngadventuress.com/2017/10/hikes-canadian-rockies.html

(google search) (amazon search)


Tue Oct 31 10:18:25 HKT 2017 From /weblog/java/fundamental

java.lang.ref


Overview of weak, soft and Phantom References
Second, PhantomReferences avoid a fundamental problem with finalization: finalize() methods can "resurrect" objects by creating new strong references to them. So what, you say? Well, the problem is that an object which overrides finalize() must now be determined to be garbage in at least two separate garbage collection cycles in order to be collected. When the first cycle determines that it is garbage, it becomes eligible for finalization. Because of the (slim, but unfortunately real) possibility that the object was "resurrected" during finalization, the garbage collector has to run again before the object can actually be removed. And because finalization might not have happened in a timely fashion, an arbitrary number of garbage collection cycles might have happened while the object was waiting for finalization. This can mean serious delays in actually cleaning up garbage objects, and is why you can get OutOfMemoryErrors even when most of the heap is garbage.

With PhantomReference, this situation is impossible -- when a PhantomReference is enqueued, there is absolutely no way to get a pointer to the now-dead object (which is good, because it isn't in memory any longer). Because PhantomReference cannot be used to resurrect an object, the object can be instantly cleaned up during the first garbage collection cycle in which it is found to be phantomly reachable. You can then dispose whatever resources you need to at your convenience.

Arguably, the finalize() method should never have been provided in the first place. PhantomReferences are definitely safer and more efficient to use, and eliminating finalize() would have made parts of the VM considerably simpler. But, they're also more work to implement, so I confess to still using finalize() most of the time. The good news is that at least you have a choice.

http://weblogs.java.net[..]las/archive/2006/05/understanding_w.html

The other valuable reference about object life cycle - http://java.sun.com[..]ormance/1st_edition/html/JPAppGC.fm.html

Incorrect use of reference can cause GC issue - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4405807

fews more related blog - http://www.egimaben.com[..]garbage-collector-and-reference-objects/ https://medium.com[..]in-java-and-why-they-matter-c04bfc9dc792

(google search) (amazon search)