Forum Discussion
Datas science Fabric Notebook run issue - Session restart
While working on notebook, frequently I am facing this issue , note I am using the Trial version data science.
InternalError: Ipython kernel exits with code 9. Please restart your session.
Here is tips regarding writing code on notebook:
1- Avoid or declare any kind of unwanted variable. you can simply use the del to delete it from memory. try to use one variable and override it again and again.
2- add the following code start of the cell (beginning of notebook), %reset -f (Clear all variables forcefully). re-run the all cells
6 Replies
- v-cboorla-msftMicrosoft Employee
Hi asifraza
Thanks for using Microsoft Fabric Community.
As I understand that you are encountering an error message
"InternalError: Ipython kernel exits with code 9. Please restart your session."while running on Notebook. This error message indicates that the IPython kernel has exited with a code - 9, which usually means that the kernel has been killed by the operating system.There could be several reasons why this is happening.
One possible reason is that the kernel is running out of memory. You can try to reduce the memory usage of your code by optimizing your code or reducing the size of the data you are working with. Check if any large data structures are causing memory exhaustion.
Another possible reason is that there is a bug in operating system that is causing the kernel to crash. You can try to check the logs as mentioned in the document : Use the Monitoring hub.
If the issue persists, you can try restarting your session or the kernel to see if that resolves the issue.
I hope this information helps. Please do let us know if you have any further questions.
Thanks.
- asifrazaRegular Visitor
v-cboorla-msft Thanks for your prompt answer, could you please share the steps how i can check the
1- kernel is running out of memory?
2- How to restart the kernal or session in notebook / datascience?
Please note, i;m using the trial version.
Thanks.- v-cboorla-msftMicrosoft Employee
Hi asifraza
1. The Microsoft Fabric Capacity Metrics app is designed to provide monitoring capabilities for Microsoft Fabric capacities. Use the app to monitor your capacity consumption and make informed decisions on how to use your capacity resources.
For more details please refer : What is the Microsoft Fabric Capacity Metrics app
2. Stop session cancels the running and waiting cells and stops the current session. You can restart a brand new session by selecting the run option again.
For more details please refer: restart session.
I hope this information helps. Please do let us know if you have any further questions.
Thanks.
- asifrazaRegular Visitor
Here is tips regarding writing code on notebook:
1- Avoid or declare any kind of unwanted variable. you can simply use the del to delete it from memory. try to use one variable and override it again and again.
2- add the following code start of the cell (beginning of notebook), %reset -f (Clear all variables forcefully). re-run the all cells
- v-cboorla-msftMicrosoft Employee
Hi asifraza
We are glad to hear that your query got resolved. Please continue using Microsoft Fabric Community for your further queries. Your insights on writing code within notebooks will be beneficial to other community members. Thank you for your contribution.
Thanks.