In the picture is a Photovoltaic mosfet driver. So I understand that the JFET is used to discharge the MOSFET gate to source capacitance to decrease its turn of time. Whats the function of the 2M resistor ?, they dont say how its calculated. If its a bleeder resistor then shouldnt it be connected from gate to source like below?
Yes. In the p-channel JFET there is a PN junction across the source-gate terminal. This junction has a very low capacitance. When the voltage on the gate falls to zero, the gate-source capacitor, namely Cgs, starts to discharge through the 2M ohms resistor.
Then the charge quickly disappears and JFET starts to conduct. This will turn off the MOSFETs.