For example, "This doesn't cause any crash but later it can cause unknown memory-crashes."
I see here that the subject 'it' is not immediately after 'but'. Do I still need to use a comma before 'but' as it links another subject?
If I understand you intent correctly, try something like:
Punctuation is almost a musical notation.
Pronounce your sentence aloud, note when you take a short breath (then comma), when you mark a small pause (then ;), when your take a lower, or higher, pitch (then - ... -), and when you mark a pause (then .) ; as for the intonation of interrogative or exclamatory sentences, it is obvious (? or !).
I recorded your sentence, said aloud :
This doesn't cause any crash but later it can cause unknown memory-crashes.
For this very simple example, I got ( "/" meaning : "taking a short breath") :
a) This doesn't cause any crash / but / later it can cause unknown memory-crashes.
it could have been :
b) This doesn't cause any crash / but later / it can cause unknown memory-crashes.
c) This doesn't cause any crash / but / later / it can cause unknown memory-crashes.
The stress is on :
a) you are not completely sure
b) the present situation is not a guarantee for the future
c) you are suspicious about the future
The use of a comma before but — also known as Oxford Comma — is optional, although I prefer to use it in longer, complicated sentences. To my understanding, if the two phrases before and after but (or any other conjunction) can exist as complete individual sentences, I would use a comma.