I agree with Phil, in this context "knowing" does not have a function of a subject or object. It has the function of an adjective. Take a look at this example: "I saw the child STANDING in the middle of the road." The word "standing" describes "the child" as "knowing" describe the state/condition of the subject in your original sentence.
“EXERCISING is good for your body" - Exercising is a gerund that functions as the subject of the sentence. Is, the verb that follows, is in the third-person singular form.
“She enjoys RUNNING daily.” What does she do? She enjoys. What does she enjoy? Running. Here, running is a gerund that functions as the object of the verb "enjoys". The gerund phrase in this sentence is “running daily.”
Besides that, G=gerunds can also be used as the object of a PREPOSITION. Common prepositions used with gerunds include of, about, to, before, and after. For example, “He’s excited about BEING off work on Friday.” "Being" is a gerund that functions as the object of the preposition about. "Being off work on Friday" is the full gerund phrase.
Finally, gerunds can also function as SUBJECT COMPLEMENTS. A subject complement is a noun that follows a linking verb. Linking verbs are forms of the verb to be, such as am, is, are, was, and were. Here’s an example of a gerund used as a subject complement: “The group’s main goal is ELIMINATING poverty.” Here, "eliminating" is a gerund that acts as the complement of the subject goal.