recently i have spent some time to break a monolith project into multiple modules within a single monorepo.

it was a huge codebase with several different projects commingled together into a same git repo. after the change, it now break into different modules, literally several microservies in a monorepo.


# import asyncioimport sslfrom socket import socketimport websocket# import websocketsdef on_message(ws, message):print ('message received ..')print (message)def on_error(ws, error):print ('error happened .. ')print (error)def on_close(ws):print ("### closed ###")def on_open(ws):print ('Opening Websocket connection to the server ... ')

i have a large app which is currently running with 600GB max memory (Xmx). the app is processing at a controlled rate now (every half an hour) to avoid an OOM.

each run is consuming and processing >3.2 …

a big memory drainer is the string objects.

with the object header, pointer for the char array, there are minimum ~20 bytes (varies by java version) occupied even for a empty string.

this could become an especially a big problem, if a large volume (like millions of records) of messages…

What language does this apply to?

If it’s a proto syntax change, is it for proto2 or proto3?

If it’s about generated code change, what programming language?

Describe the problem you are trying to solve.
For the message below,

message Position { string portfolio =1; }


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