
Heapdump 크기 : 1.5G Parsing 결과 : Total 357.3MB Unreachable (GC 대상) 객체는 MAT 기본 설정으로 파싱하지 않도록 되어있다. Unreachable 객체까지 Parsing 하기 위해서는 Preferences > Memory Analyzer > Keep unreachable objects 체크 이전에 파싱된 결과는 모두 제거하고 다시 파싱. Heapdump 크기와 거의 비슷한 parsing 결과를 얻을 수 있다.

mysql-connector-java -> mariadb-connector-j 로 변경할때 같은 데이터를 바라보지만 다른 값이 리턴될 수 있다. books 테이블에는 deleted 필드가 존재하고 해당 필드에는 CHAR 형식으로 삭제 여부 데이터가 저장된다. deleted = 'Y' : 삭제된 책 deleted = 'N' : 삭제되지 않은 책 ResultSet.getBoolean() 함수를 이용하여 해당 필드의 데이터를 가져오면 'Y', 'N' 의 Char 값을 boolean 으로 리턴해준다. 이때 mysql-connector-java 와 mariadb-connector-j 의 동작 방식 차이에 의해서 리턴값이 달라진다. Connector Data Return boolean mysql-connector-..

https://github.com/mariadb-corporation/mariadb-connector-j https://mariadb.com/kb/en/failover-and-high-availability-with-mariadb-connector-j/#specifics-for-amazon-aurora mariadb-connector-j 를 사용하여 Aurora DB 로 connection 을 맺게 되면 Transaction 의 readOnly 값에 따라서 read 와 write 가 서로 다른 DNS 로 전달되게 된다. 그 과정을 코드 레벨로 확인한다. 0. read/write seperate 동작 확인 Cluster(Writer) : dev56-a.cluster Cluster(Reader) : dev5..

Netty 의 NioEventLoop.java 코드 중 핵심이 되는 run() 메서드 분석 MacOS 를 사용중이기 때문에 KqueueSelectorImpl.java 가 사용되었다. EventLoop.java 는 두가지를 처리한다. I/O : Channel 로 부터 발생한 Event 를 받아 I/O Non I/O : Task Queue 에 들어있는 Task 처리. NioEventLoop 생성 static { DEFAULT_EVENT_LOOP_THREADS = Math.max(1, SystemPropertyUtil.getInt( "io.netty.eventLoopThreads", NettyRuntime.availableProcessors() * 2)); if (logger.isDebugEnabled()) ..
1. Client 용 ChannelHandler 작성 public class NettyClientHandler extends SimpleChannelInboundHandler { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { ctx.writeAndFlush(Unpooled.copiedBuffer("Woongs netty client!", CharsetUtil.UTF_8)); } @Override protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { System.out.println("Client recei..

1. ChannelHanlder 작성 ChannelHandler 는 이벤트를 수신하고 이벤트에 해당하는 비지니스 로직을 구현할 수 있는 컴포넌트 Netty Server 는 Inbound 이벤트에 반응해야 하므로 ChannelInboundHandler 인터페이스를 구현 @ChannelHandler.Sharable public class NettyServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // msg 가 들어올때마다 호출 ByteBuf in = (ByteBuf) msg; System.out.pr..

Netty 는 비동기식 이벤트 기반 네트워킹 프레임워크 1. Java IO 라이브러리의 단점 Socket 하나당 Thread 하나가 할당되어 Stack Memory 에 Thread 가 쌓임. Client 가 요청을 보내올때까지 대기상태인 Thread는 리소스 낭비. 분당 수십만의 요청을 받는 서버라면 Context Switching 비용이 증가. 2. Java NIO 의 등장 Selector 를 통해 하나의 Thread 가 여러개의 요청 수행 가능 DitrectByteBuffer 를 사용해 OS -> JVM 으로 데이터를 가져오는 Overhead 와 가져온 데이터를 GC 해야하는 Overhead 제거 3. Netty 의 핵심 컴포넌트 Channel Callback Future EventHandler 3...

HashMap 에서 HashTable 을 관리하는 방법과 seperate chaining 이해를 위한 목적의 글입니다. /** The table, initialized on first use, and resized as necessary. When allocated, length is always a power of two. (We also tolerate length zero in some operations to allow bootstrapping mechanics that are currently not needed.) **/ transient Node[] table; HashTable 은 내부에 table 맴버 변수를 가지고 있고 이 변수가 HashTable 의 역할을 수행합니다. put(key,..

Note that this implementation is not synchronized. If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally. Java 의 HashMap 은 Thread Safe 하지 않기 때문에 동시에 여러 쓰레드가 접근할 경우에 외부에서 synchronized 처리가 필요하다. 멀티 쓰레드 환경에서 Thread Safe 하지 않은 HashMap 에 발생할 수 있는 현상. final Map map = new HashMap(); final Integer targetKey =..
- Total
- Today
- Yesterday
- msyql-connector-java
- circurit breaker
- DyanomoDB
- mariada-connector
- Flux
- RoutePredication
- MariaDB
- dynamodb
- referencedColumnName
- AbstractMethodError
- rate limit
- ConcurrentHashMap
- aurora
- N+1
- RouteDefinition
- notify()
- reactor
- spring cloud gateway
- router
- HashMap
- reative
- GlobalFilter
- Seperate Chaining
- custom config data convertion
- notifyAll()
- Lazy
- wait()
- ResultSet
- getBoolean
- mariadb-connector-j
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |