It seems that our hibernate mapped fields (or at least the getters/setters) have to be byte arrays instead of Strings in order to use international characters (supplementary) with mysql and hibernate...
https://forum.hibernate.org/viewtopic.php?f=1&t=1003567&p=2428021So byte arrays of UTF-8 characters at least reduces our memory usage for strings as now the vast majority of time (in our case) we'll have strings with the number of characters being the number of bytes of memory used. Whereas java Strings use up more than twice the number of bytes of memory as number of characters. Since the data we're dealing with takes up a tremendous amount of memory, this is important.
Now I need to modify our Hibernate Search mappings. I thought, easy enough, just make a byte array field bridge and convert the byte arrays to java Strings (and vice-versa). But now my memory usage actually
increases compared to before because I'll still have the same Strings but also the new byte arrays. This can be a problem for us. I know they Strings will get garbage collected afterwards, but this kind of garbage collecting has been unusably slow for us.
So my question is, is there a better way to deal with UTF-8 byte arrays with Hibernate Search? Can Hibernate Search deal with them more directly, maybe without a field bridge?