![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/EdN9h/btqLA4ioX1J/9noSUkGMDg0u5qKOTr22Dk/img.png)
참조(Reference)와 GC(Garbage Collection)의 관계 1. Strong Reference public class JavaTest { public static void main(String[] args) { MyClass obj = new MyClass(); obj = null; // "obj" object is no longer referencing to the instance. // So the "MyClass" type object is now available for garbage collection. } } class MyClass { } // Java program to illustrate Strong reference class MyClass { //Code.. } pub..
1. StrongReference - 일반적으로 new를 통해서 객체를 생성하게 되면 생기게 되는 참조 - 강한 참조를 통해 참조되고 있는 객체는 GC(Garbage Collection)의 대상에서 제외 - GC(Garbage Collection)가 발생해도 객체가 해제되지 않기 때문에 OOM(Out of memory)이 발생할 수 있음 2. SoftReference - 강한 참조와는 다르게 GC(Garbage Collection)에 의해 수거될 수도 있고, 수거되지 않을 수도 있음 - 메모리에 충분한 여유가 있으면 GC(Garbage Collection)가 수행돼도 수거되지 않음 - GC(Garbage Collection)가 발생하면 수거되므로 OOM(Out of memory)의 위험성을 줄일 수 있음..
- Total
- Today
- Yesterday
- java
- Intent
- Architecture Pattern
- 안드로이드 #코틀린 #Android #Kotlin
- Vue.js #Vue.js + javascript
- ViewModel
- activity
- ViewPager2
- Livedata
- TabLayout
- Android
- 안드로이드
- 코틀린
- Kotlin
- 자바
- James Kim
- 혀가 길지 않은 개발자
- DataBinding
- MVVM
- CoordinatorLayout
- fragment
- recyclerview
- handler
- JSONArray
- Design Pattern
- XML
- ArrayList
- coroutine
- JSONObject
- View
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |