<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Liu on Medium]]></title>
        <description><![CDATA[Stories by David Liu on Medium]]></description>
        <link>https://medium.com/@anythingsimple?source=rss-1e6e889c927d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*REvryJ_ll9tyfDRLuoVV0Q.jpeg</url>
            <title>Stories by David Liu on Medium</title>
            <link>https://medium.com/@anythingsimple?source=rss-1e6e889c927d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:24:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anythingsimple/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using ccm(Cassandra Cluster Manager) to run Cassandra Cluster for DEV]]></title>
            <link>https://anythingsimple.medium.com/using-ccm-cassandra-cluster-manager-to-run-cassandra-cluster-for-dev-8734b79766dc?source=rss-1e6e889c927d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8734b79766dc</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[cassandra]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[David Liu]]></dc:creator>
            <pubDate>Fri, 09 Apr 2021 00:23:26 GMT</pubDate>
            <atom:updated>2021-04-09T16:27:22.828Z</atom:updated>
            <content:encoded><![CDATA[<h4>A quick and easy way to test application behaviors using Cassandra Cluster locally with the help of ccm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1fa6v4es3HehU_QmwNA3w.png" /></figure><p>Recently, in one of my AKKA projects, I needed to understand how the AKKA application behaves when one, two, or all of the nodes went down. Normally, I would have coordinated with the SREs to carry out these kinds of tests on our Integration environment, which is tedious and inconvenient. Luckily, there is a script/library called <a href="https://github.com/riptano/ccm">ccm(Cassandra Cluster Manager)</a> that can help. It makes it easy to create, manage, and destroy Cassandra Clusters on a local box. Today, we will be going through the process of getting ccm running on Windows 10.</p><p>Here are the high level steps:</p><ul><li>Install Python by using <a href="https://docs.conda.io/en/latest/miniconda.html">Miniconda</a></li><li>Install ccm and its dependencies</li><li>Use ccm to create and manage a Cassandra Cluster</li></ul><h4>Install Python by using <a href="https://docs.conda.io/en/latest/miniconda.html">Miniconda</a></h4><p>To make your local Python environments cleaner, it is a good idea to use something like Miniconda to manage your Python environments.</p><p>On Windows 10, go to the <a href="https://docs.conda.io/en/latest/miniconda.html">Miniconda website</a>. Download the Miniconda2 Windows 64-bit installer and install it to your Windows 10.</p><p>After the installation, start the Anaconda Prompt (Miniconda2) to create a new environment for ccm: ccm_env</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c663db9a84692c6be9daf5be5d2ac6d/href">https://medium.com/media/5c663db9a84692c6be9daf5be5d2ac6d/href</a></iframe><h4>Install ccm and its dependencies</h4><p>Now let’s install ccm by using the newly created ccm_env;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3942c44f23aae42ff9ad76fdebb925d3/href">https://medium.com/media/3942c44f23aae42ff9ad76fdebb925d3/href</a></iframe><p>One of the ccm dependencies is Apache ant. You can download the binary for ant from the Apache <a href="https://downloads.apache.org/ant/binaries/">ant download website</a> and extract it to a convenient folder. Remember to add the ant’s bin folder to your PATH environment variable.</p><h4>Use ccm to create and manage a Cassandra Cluster</h4><p>With all the heavy work done, it is now time to use the ccm on your local box.</p><p>In a Powershell window, run Set-ExecutionPolicy -ExecutionPolicy Unrestricted to enable Unrestricted ExecutionPolicy.</p><p>To create and manage a Cassandra Cluster, you need to run the following commands in the ccm_env Scripts folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9fa21171473a45e234bdcaf615c8a9ae/href">https://medium.com/media/9fa21171473a45e234bdcaf615c8a9ae/href</a></iframe><p>Now you have started a three-node Cassandra Cluster on your local box. You can connect your application to it and test/debug whatever you need to know about your application’s behaviors when one, two, or all of the nodes of Cassandra Cluster go down locally!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8734b79766dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maintain MySQL without downtime by using ProxySQL]]></title>
            <link>https://anythingsimple.medium.com/maintain-mysql-without-downtime-by-using-proxysql-632ab6d6f00f?source=rss-1e6e889c927d------2</link>
            <guid isPermaLink="false">https://medium.com/p/632ab6d6f00f</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[downtime]]></category>
            <category><![CDATA[maintenance]]></category>
            <category><![CDATA[proxysql]]></category>
            <dc:creator><![CDATA[David Liu]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 01:34:07 GMT</pubDate>
            <atom:updated>2021-03-26T01:34:07.171Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use ProxySQL to maintain a MySQL Database without downtime</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*pldmMAkTlSL42OGN2mgW6w.png" /><figcaption>ProxySQL</figcaption></figure><p>When running a MySQL database on a production environment, we would like to be able to take one of the DB nodes offline to do the maintenance work on that node, and later put that DB node back online after the maintenance.</p><p>To make this maintenance process transparent to the applications connecting to the MySQL Database, we are using <a href="https://proxysql.com/">ProxySQL </a>to route the traffic from applications to the backend MySQL DB nodes.</p><blockquote>ProxySQL is a high performance, high availability, protocol aware proxy for MySQL and forks (like Percona Server and MariaDB).</blockquote><p>Whenever you would like to pull a MySQL DB from your cluster to maintain, there are normally the following concerns that you need to address:</p><ul><li>How does it affect my in-flight transactions?</li><li>How does it affect my existing DB connections?</li><li>How does it affect my new transactions?</li></ul><p>Based on the concept from Ratnadeep Debnath’s talk: <a href="https://www.youtube.com/watch?v=LNLIUH5OZ1o">Scale MySQL beyond limits with ProxySQL</a>, we will manually simulate the process of doing maintenance on one DB node in a cluster behind a ProxySQL server.</p><h4>Disclaimer: the docker-compose files are folked from <a href="https://github.com/zapier/proxysql-benchmark">Ratnadeep Debnath’s github repo</a>.</h4><p>You can find the source code on <a href="https://github.com/davidlzs/proxysql-benchmark">GitHub</a>.</p><p>Our lab settings looks like this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*fTG7JcOamVHUxPEpc_jVCg.png" /><figcaption>lab settings</figcaption></figure><ul><li>proxysql — our container running ProxySQL</li><li>db1, db2 — our container running the two backend MySQL Databases; note: there is no synchronization between them in our lab.</li><li>simulated application — a bash command shell in our test docker container to simulate an application connecting to MySQL via ProxySQL.</li><li>proxysql admin — a bash command shell in our test docker container to manage msql_query_rules by connecting to the ProxySQL admin.</li><li>direct client to db1, direct client to db2 — bash command shells in our test docker container to check the data written on each backend DB.</li></ul><p>Here are the high level steps:</p><ul><li>Start docker containers and setup the test table</li><li>Start in-flight transaction</li><li>Switch destination_hostgroup for our test user</li><li>Commit the in-flight transaction</li><li>Shutdown db1</li><li>Test a new transaction after shutting down db1</li></ul><p>Now, let’s get hands-on and manually simulate pulling out db1 from our dummy cluster;</p><h4>Start docker containers and setup the test table</h4><p>Start the docker containers by issuing command: docker-compose up -d</p><p>This will start the following docker containers;</p><p>Creating db_backend_switch_db1_1 … done<br>Creating db_backend_switch_db2_1 … done<br>Creating db_backend_switch_proxysql_1 … done<br>Creating db_backend_switch_nose_1 … done</p><p>Now let’s hop on to the db_backend_switch_nose_1 by opening a bash shell to it and creating our test DB schemas in db1 and db2.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6493bf8b276f12d5c2ac20714fa4577d/href">https://medium.com/media/6493bf8b276f12d5c2ac20714fa4577d/href</a></iframe><h4>Start in-flight transaction (simulated application)</h4><p>Let’s open a bash command shell in our test docker container to simulate an application connecting to MySQL via ProxySQL;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe6484c702d815fbe9e9db5ca233e9bc/href">https://medium.com/media/fe6484c702d815fbe9e9db5ca233e9bc/href</a></iframe><p>Now we have a in-flight transaction, which by default should connect to the backend DB: db1.</p><p>You can verify that the transaction is not yet committed by directly connecting to db1.</p><h4>Switch destination_hostgroup for our test user (proxysql admin)</h4><p>With an in-flight transaction set up, we are now ready to switch the query rule for our test user sbtest1 from sending queries to db1 to sending queries to db2;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48f4b43793da4f9b0c1803572603a818/href">https://medium.com/media/48f4b43793da4f9b0c1803572603a818/href</a></iframe><h4>Commit the in-flight transaction(simulated application)</h4><p>Now we can come back to our simulated application to commit our in-flight transaction by issuing commit; Voila! It works. You can verify the transaction was successfully committed to db1 by directly connecting to db2.</p><h4>Shutdown db1</h4><p>Let’s shutdown the db1 docker container by issuing a docker-compose command on host machine: docker-compose stop db1</p><h4>Test new transaction after shutdown db1(simulated application)</h4><p>Now let’s use the simulated application to test a new transaction;</p><p>You will notice that when you issue begin in the mysql client, you will get an error: ERROR 2013 (HY000): Lost connection to MySQL server during query</p><p>⚠️To avoid this error in your application, you should do a connection test in your connection pool if you use one; don’t let your connection pool lend a bad connection to your application.</p><p>However, the mysql client automatically reconnected to MySQL DB via ProxySQL. Now let’s restart the new transaction and give it a try. Voila! It worked. You can verify that the transaction was successfully committed to db2 by directly connecting to db2.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29aa9808dce21bfcd0a903c3ca79020c/href">https://medium.com/media/29aa9808dce21bfcd0a903c3ca79020c/href</a></iframe><p>Here we manually demoed how ProxySQL can help you handle: an in-flight transaction, a new transaction, and an existing connection when you are pulling out a DB node from your DB cluster. Of course, we would not want to do all these tedious and error-prone steps on our production environment. So, please look forward to my next blog post about how to handle it automatically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=632ab6d6f00f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to convert Cassandra TimeUUID stored in the TEXT field to a TimeStamp in cql?]]></title>
            <link>https://anythingsimple.medium.com/how-to-convert-cassandra-timeuuid-stored-in-the-text-field-to-a-timestamp-in-cql-26958315fd9b?source=rss-1e6e889c927d------2</link>
            <guid isPermaLink="false">https://medium.com/p/26958315fd9b</guid>
            <category><![CDATA[timestamp]]></category>
            <category><![CDATA[cassandra]]></category>
            <category><![CDATA[conversion]]></category>
            <category><![CDATA[cql]]></category>
            <category><![CDATA[timeuuid]]></category>
            <dc:creator><![CDATA[David Liu]]></dc:creator>
            <pubDate>Fri, 19 Mar 2021 19:06:09 GMT</pubDate>
            <atom:updated>2021-03-19T19:06:09.748Z</atom:updated>
            <content:encoded><![CDATA[<h4>An example of a UDF (User-Defined Function) in Cassandra</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1fa6v4es3HehU_QmwNA3w.png" /></figure><p>The Akka Projection library stores TimeUUID values as TEXT in the offset_store table. When you query the offset from the offset_store table, it shows the UUID string. It would be nice if it could be converted to a human-readable timestamp. Unfortunately, after hours of fruitless googling, I decided to create my own UDF (User-Defined Function) in Cassandra to make the conversation possible.</p><p>First, let’s look at the schema of the Akka Projection offset storage table in Cassandra;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7699e998a9c791c11224da30e732211/href">https://medium.com/media/c7699e998a9c791c11224da30e732211/href</a></iframe><p>The column we are interested in is offset .</p><p>Second, let’s create the UDF in Cassandra;</p><ul><li>By default, Cassandra disables user defined functions. You can enable it by editing cassandra.yaml. Remember to restart your Cassandra;</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09fae59aaccba2fb722841d6e52b8314/href">https://medium.com/media/09fae59aaccba2fb722841d6e52b8314/href</a></iframe><ul><li>Now we are ready to create our own function: textToTimestamp</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d3cc0445816f2412ddc72cee33d07c9/href">https://medium.com/media/5d3cc0445816f2412ddc72cee33d07c9/href</a></iframe><p>Finally, we are ready to use the UDF that was just created in a cql SELECT statement;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*ZC16_kGJ1wLXgCKiTzLOWA.png" /><figcaption>textToTimestamp</figcaption></figure><p>Here you go, you can easily see the timestamp of the offset column.</p><p>If you know any other way of converting TimeUUID stored in the TEXT column to a human-readable format in cql, please comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26958315fd9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to do network sniff for Kubernetes pod running on GKE?]]></title>
            <link>https://anythingsimple.medium.com/how-to-do-network-sniff-for-kubernetes-pod-running-on-gke-fb23d0b63e95?source=rss-1e6e889c927d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb23d0b63e95</guid>
            <category><![CDATA[ksniff]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[tcpdump]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[wireshar]]></category>
            <dc:creator><![CDATA[David Liu]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 23:57:54 GMT</pubDate>
            <atom:updated>2021-03-17T23:57:54.076Z</atom:updated>
            <content:encoded><![CDATA[<h4>capture tcpdump remotely for any kubernetes pod</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFuRNpegr8ydcEKgiWAnIA.png" /><figcaption>wireshark</figcaption></figure><p>Recently, when we ran into an intermittent network slowdown for a service deployed on <a href="https://cloud.google.com/kubernetes-engine">GKE</a>, we thought it would be nice if we could capture the TCP packets for analysis to gain some insights on what is going on from the service side. <a href="https://github.com/tcdowney">Tim Downey</a> described how to capture network traffic by using Ephemeral Containers in <a href="https://downey.io/blog/kubernetes-ephemeral-debug-container-tcpdump/">capturing network traffic from a kubernetes pod with ephemeral debug containers</a>. Unfortunately, we don’t have Ephemeral Containers enabled in our GKE cluster. Luckily, Tim gave us an alternative method to capture network packets even without Ephemeral Containers — using <a href="https://github.com/eldadru/ksniff">ksniff</a>. Today, I will walk you through how to set up <a href="https://github.com/eldadru/ksniff">ksniff</a> to capture network packets in a K8S pod running on GKE.</p><blockquote><a href="https://github.com/eldadru/ksniff">ksniff</a> is a kubectl plugin that utilizes tcpdump and Wireshark to start a remote capture on any pod in your Kubernetes cluster. You get the full power of Wireshark with minimal impact on your running pods.</blockquote><p>⚠️ Ksniff <a href="https://github.com/eldadru/ksniff/issues/96#issuecomment-762454991">isn’t production ready yet</a>, running ksniff for production workloads isn’t recommended at this point.</p><p>We will walk through the steps to install the ksniff, wireshark, and X Server on WSL running on Windows 10.</p><h4>Tools used:</h4><ul><li>Windows 10 WSL</li><li>Wireshark + X Server (<a href="https://sourceforge.net/projects/vcxsrv/">VcXsrv Windows X Server</a>)</li><li>kubectl</li><li>ksniff</li></ul><h3>Steps:</h3><h4><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-binary-with-curl-on-linux">Install the latest kubectl</a></h4><p>To use ksniff, you need to have the latest kubectl installed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1262299b048f354f2d4f96cf21ed9cb1/href">https://medium.com/media/1262299b048f354f2d4f96cf21ed9cb1/href</a></iframe><h4>Build and Install ksniff from source</h4><p>Normally, installation of ksniff is very straightforward. However, I ran into an e<a href="https://github.com/eldadru/ksniff/issues/82">rror when I ran ksniff in privileged mode</a> on GKE, because the support of the socket option is not available in any of the release builds yet. I had to build and install ksniff from the source code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12ac76f62dde98ed83ac8ea55e370a78/href">https://medium.com/media/12ac76f62dde98ed83ac8ea55e370a78/href</a></iframe><h4>Install newer version of Wireshark</h4><p>You may see all your captured packets showing <a href="https://github.com/eldadru/ksniff/issues/100">“Unknown” in Protocol column</a>. It is caused by the fact that Wireshark does not support the tcpdump command captured packet format. You will need to install newer version of Wireshark.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63b408f7d7296ec2d7e8f41aaf097747/href">https://medium.com/media/63b408f7d7296ec2d7e8f41aaf097747/href</a></iframe><h4><a href="https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-wsl-gui-apps-on-windows-10/ba-p/1493242">Setup X Server (VcXsrv Windows X Server)</a></h4><p>To run the Wireshark in WSL, we need to have an X Server setup. Here we are using the VcXSrv Windows X Server.</p><p>After you installed the VcXsrv on Windows 10, you can set your DISPLAY environment variable in WSL by;</p><ul><li>Find out the Windows ip by using ifconfig command.</li><li>Set the DISPLAY environment variable by using export DISPLAY=”x.x.x.x:0&quot;</li></ul><h4>Run ksniff in privileged mode to capture network traffic on GKE</h4><p>Now you can start to sniff the network traffic from the K8S pod on GKE and do your packet analysis;</p><ul><li>Start the X Server on your Windows 10. Otherwise, you may not be able to start the Wireshark, which causes the temporary ksniff pod got killed. You may see the following error: failed to start sniffing using privileged pod, exit code: ‘137’ error=”command terminated with exit code 137&quot;</li><li>Start sniffing by issuing the command: sudo kubectl sniff &lt;your-pod-name-here&gt; -f “port 8080” -n default -p — socket /var/run/docker.sock</li><li>When you are done with the capturing, you may need to manually delete the ksniff temporary pod from your GKE cluster.</li></ul><p>Hope this is helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb23d0b63e95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I nailed down a memory leak in an Akka application]]></title>
            <link>https://anythingsimple.medium.com/how-i-nailed-down-a-memory-leak-in-an-akka-application-f8291cac63f5?source=rss-1e6e889c927d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8291cac63f5</guid>
            <category><![CDATA[memory-l]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[akka]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[diagnosis]]></category>
            <dc:creator><![CDATA[David Liu]]></dc:creator>
            <pubDate>Sat, 24 Oct 2020 17:32:15 GMT</pubDate>
            <atom:updated>2020-10-24T17:32:15.840Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, a project I was working on experienced a memory leak problem. I used JVM verbose GC log, <a href="https://gceasy.io/">GCeasy.io</a>, <a href="https://www.eclipse.org/mat/">Eclipse Memory Analyzer (MAT)</a>, and IntelliJ to figure out the root cause of the problem and fixed it.</p><p>While monitoring our distributed Akka application, I noticed that one of the Akka micro-service spills out warnings of “slow heartbeat”, which suggests a look into the slow GC of the JVM.</p><p>First, I turned on verbose GC on the JVM running the problematic micro-service, with the help of GCeasy.io, I could clearly tell there was a memory leak which makes the full GC slower and slower.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKa_jwTIYB5FIJG2BUXMmQ.png" /><figcaption>Heap size after GC</figcaption></figure><p>It was a nice first step to confirm that the slow GC was caused by a memory leak; however, the next question is what caused the memory leak and how I can get more insight of the JVM heap when the slow GC happens. Secondly, I took a heap dump and used Eclipse Memory Analyzer (MAT) to analyze which class holds the most of the memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*dVpz-0gSVed7S4E530PljA.png" /><figcaption>Memory leak suspect view in MAT</figcaption></figure><p>With the help of the heap dump and Eclipse Memory Analyzer (MAT) I could affirm that the memory leak is created too many instances of class: <strong>akka.actor.LightArrayRevolverScheduler</strong>. Then I googled and read the Akka documentation, which made me think that the memory leak is related to the scheduled jobs.</p><p>Thirdly, I pulled out the Akka source code in IntelliJ and found the code where the jobs were scheduled and set a break point on that line of code. After starting the micro-service in debug mode, sending a few messages to the micro-service, voila! The break point was triggered for each message sent to the micro-service. In the application, the micro-service was supposed to have millions of messages sent to it, which means that every message it received, it would start a new scheduled job. Here you are, this is the memory leak I was hunting for. Based on the call stack I figured out that for each every message the micro-service receives we are using <strong>SerializationExtension.createExtension(system)</strong> rather the <strong>SerializationExtension.get(system)</strong>.</p><p>The solution is simple, replacing all the <strong>SerializationExtension.createExtension(system)</strong> call with <strong>SerializationExtension.get(system)</strong> call, the memory leak was fixed.</p><p>It was a good journey to dig out this interesting problem. What I learnt from the process is that always ask yourself what I can see more information related to my question and what kind of tools I should use:</p><p>Slow GC? — <a href="https://wiki.openjdk.java.net/display/shenandoah/Main">Verbose GC</a></p><p>Memory Leak? — Heap Dump +<a href="https://www.eclipse.org/mat/">Eclipse MAT</a></p><p>Why the code logic happens — IntelliJ + Source Code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8291cac63f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>