Mostly Linux & Python syntax notes and hyperlinks.

Wednesday, July 26, 2023

Xms size must be multiple of 1024

 from java (oracle.com) and java (oracle.com):

-Xmssize

Sets the minimum and the initial size (in bytes) of the heap. This value must be a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes.

The following examples show how to set the size of allocated memory to 6 MB using various units:

-Xms6291456
-Xms6144k
-Xms6m

Also for 

Friday, April 28, 2023

Compressed Windows C-drive and LTS Ubuntu

I compressed my PC's Windows 10 C drive after spending a very long time trying to figure out how to get it out of the "red". Unfortunately, the next time I started up LTS Ubuntu, it complained about the virtual disk being compressed and would not start up.

I followed other web advice to look under C:\users\[me]\AppData\Local\Packages

There I found something named CanonicalGroupLimited.Ubuntu20.04onWindows_79rblahblah ..

After I decompressed that package LTS Ubuntu worked again.

Wednesday, March 22, 2023

python len() for record offsets

 From a colleague:

In case you ever have to do an f.seek():

When calculating record offsets, python only does a consistent and correct len() value if your file is opened in binary.


Friday, March 3, 2023

Performance illusion from using repetitive test data

We often copy a few fake records to create a large input file with which to test how the code handles it.

It's a useful test; but don't use it to gauge performance. 

Data from repeated records can be cached and reused. If your production data will vary, then it won't get the same use out of caching. Caching could even hurt performance.