This blog post will summarize all the efforts from the Linux community to improve the large-memory allocation over time by looking back at the development history. The key idea is collecting all sorted-by-time blog posts from the LWN.net magazine which related to memory management.

When there are any recent posts or updates on this topic, I will append to the blog and add to the edited history section to easier track.

Introduction

Since Linux is a virtual memory system, fragmentation normally is not a problem. We can treat memory as a virtually contiguous block by the virtual memory mechanism.

Once the…


Our engineering team must integrate the system into the partner’s new infrastructure. Communication between our system and partner’s infrastructure uses Kafka as the message queue. Kafka uses SASL/Kerberos for authentication. The Kafka client library our team uses is confluent-kafka-go which wrapped another C library librdkafka

Unfortunately, things do not work as expected. We cannot communicate with Kafka brokers, and we haven’t figured out the exact reason. Our team took 1 week to debug remotely, but we don’t have any useful results. So our team must go on-site to the partner’s office to access the production system.

Monday

Trying to access…


Today, I have an issue related to the DNS inside my docker container. I ask myself a very “obvious” question: how does the docker DNS work. The first Google result is:

https://kerneltalks.com/networking/how-docker-container-dns-works/

Docker is coded in a smart way. When you run new container on the docker host without any DNS related option in command, it simply copies host’s /etc/resolv.conf into the container.

The explanation is very clear. Sound likes I understand how docker DNS works. If you confuse what is the purpose of /etc/resolv.confThere is the documentation here.

I try to verify again by creating a docker container and…


Every month, if not every day, I learn many things from my work or my colleagues. However, I often forget what I studied and I feel pity for myself because the impression I haven’t improved yet :D

So I decided that I will take (maybe) 5 interesting links I learned at the end of the month. One reference will include context, a short description and how to discover more about that subject. By looking back, I can remember some interesting kinds of stuff I watched/read before. I hope you also see this useful :D

This is my first post in…


ACID (Atomic-Consistency-Isolation-Durability) is a set of database transaction properties to guarantee validity even if errors, power failures, etc. (Wikipedia). This is what I learned when sitting at the university. :D

Specifically, the definition of Isolation is: Isolation determines how transaction integrity is visible to other users and systems. (Wikipedia)

In database systems, people defined 4 isolation levels: Read Uncommitted, Read Committed, Repeatable Read, and Serializable. There are some read phenomena such as Dirty Read, Non-repeatable Read, Phantom Read, and Write Skew. Here is the matrix between isolation levels and read phenomena:


This is a first topic after I start working for Lazada. Such a busy time for writing something useful :) In this topic, we will discuss about garbage collector in Java, from the very early day we must manually manage memory by hand.

C/C++ Style

Introduction

Firstly, I will discuss how objects are managed under C/C++ environment. In C, we create an object by using keyword malloc and C++ using keyword new.

char* str = (char *) malloc(15);     // C: allocate an array of charStudent* studentPtr = new Student(); // C++: allocate a student obj

When we finish using that object, we…


Have you ever considered how much memory Android VM allow to allocate for your application? If answer is yes, how can you overcome this limitation ? This blog post will explain in detail about those things.

Reader can view all code samples in this post in my repository designed for this topic.

  1. Heap memory allocated limitation.

We come to one basic question: how much memory will Android allow for one application. Luckily we have a way for knowing this.

a. Helper method:

Android provides one method for developer knowing this. This method is useful so we can take care about…


Lập trình viên Android phải thường xuyên làm việc với Gradle build file. Do vậy chắc chúng ta không quá lạ lẫm với đoạn code sau:

apply plugin: 'com.android.application'android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.silicons.android.uploader"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}

build.gradle thoạt nhìn vào giống như một file json với các định nghĩa về thuộc tính. Thực tế build.gradle hoàn toàn xây dựng trên ngôn ngữ Groovy và lập trình viên hoàn toàn có thể để vào một số đoạn code Groovy. (ví dụ: tạo ra một task để in ra…


Android Developer often works with Gradle build file on daily life. So this piece of code is very familiar:

apply plugin: 'com.android.application'android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.silicons.android.uploader"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}

build.gradle at first looks like a json file with bunch of attribute definitions. In fact, build.gradle is based on Groovy language, and you can put some groovy code in this build file (aka: making a task for tracking dependencies). Today we will look build.gradle under Groovy microscope.

Grooooovy

This part will revisit again some groovy concepts mentioned in post.

Groovy Delegate Object

Groovy has a powerful concept named delegate for…


Link tiếng Anh: https://medium.com/@huynhquangthao/85cebdc97ab3

Đây là bài viết đầu tiên của mình về memory leak trong Android. Nói nôm na là “rò rĩ bộ nhớ", nhưng mình nghĩ dùng đúng thuật ngữ sẽ hay hơn. Nói chung chung, rất nhiều người trong chúng ta thấy ngộ ngộ, vì tại sao Java (hay Android) có thể bị memory leak được chứ? Java sử dụng một bộ thu gom rác tự động, tạm gọi là Garbage Collector, tự động thu hồi tất cả đối tượng không còn sử dụng nữa. Memory leak chỉ có thể xảy ra khi lập trình C/C++ thôi…

Huỳnh Quang Thảo

Always true 98%. Don’t care 3% others

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store