Willy Loman's character is summed up in the remark made by author Arthur Miller:
the central situation of contemporary civilization. ... is that we are struggling with forces that are far greater than we can handle, with no equipment to make anything mean anything.
On the other hand, David Malter's character can be summed up when he says in Chapter 18 that he is glad that he isn't a tzaddik with the responsibility and burden of raising a son to be the next tzaddik.
Both Willy and David have incidents when their lives approach their final ends, however there are contrasts within this similarity. Willy's approach to the end of his life is by his own choice and at his own hand. David's is health failure he is suddenly stricken with. Willy's attempt on his life is successful and ends in his death. David recovers from his undesired brush with death. In addition, the motivations compelling each man at the time of their death and near-death experiences are quite different.
Willy is crushed within his soul because he has failed in his desires, efforts and expectations: reality interfered with the fulfillment of his image of financial and family success. On the other hand, David has dedicated himself to a pursuit of a higher order, that of establishing a homeland for Jews following World War II. One man sacrifices himself to atone for his failures by leaving the payout of a life insurance policy worth $20,000 to his surviving family. The other man sacrifices himself to contribute to the grand collective task of building a homeland for persecuted Jews who had been exiled and exterminated all throughout their history, with the ultimate assault being in World War II at Hitler's hands.
In practical terms, Willy is a distanced and preoccupied husband and father with unrealistic expectations, including his dreams for his boys, though he envisions himself as something different and much better. He works hard and at one time provided amply for his family though time and circumstance has changed that. David is a generous and loving father and friend to his son and his son's best friend while being a sound and steady success in life. He humbly values freedom of expression and self-fulfillment above stringently enforced dedication to traditions (even important ones), though he gives his all to what he ardently believes in.
In sum, Willy and David are alike in some important life circumstances (e.g., encounters with death) and in their devotion to working hard for what they value. They differ in their overall circumstances (Willy is governed more strictly by externals) and in their levels of success as well as in their ability to see realistically. Nonetheless, they both have the courage and dedication to sacrifice themselves for what they see as a higher value:
WILLY LOMAN: Does it take more guts to stand here the rest of my life ringing up a zero? ... And twenty thousand—that is something one can feel with the hand, ....